红联Linux门户
Linux帮助

系统账户更改为可登陆账户

发布时间:2016-01-20 10:07:39来源:linux网站作者:炽热_蓝沙

Linux中内置账户共有很多个(cat /etc/passwd ),除了有2个可登陆账户:root和自己设置的账户外。还有些其它的账户。

在知道密码的情况下,远程电脑可以使用账户:root等登陆本机!


1   root:x:0:0:root:/root:/bin/bash
2   daemon:x:1:1:daemon:/usr/sbin:/bin/sh
3   bin:x:2:2:bin:/bin:/bin/sh
4   sys:x:3:3:sys:/dev:/bin/sh
5   sync:x:4:65534:sync:/bin:/bin/sync
6   games:x:5:60:games:/usr/games:/bin/sh
7   man:x:6:12:man:/var/cache/man:/bin/sh
8   lp:x:7:7:lp:/var/spool/lpd:/bin/sh
9   mail:x:8:8:mail:/var/mail:/bin/sh
10   news:x:9:9:news:/var/spool/news:/bin/sh
11   uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
12   proxy:x:13:13:proxy:/bin:/bin/sh
13   www-data:x:33:33:www-data:/var/www:/bin/sh
14   backup:x:34:34:backup:/var/backups:/bin/sh
15   list:x:38:38:Mailing List Manager:/var/list:/bin/sh
16   irc:x:39:39:ircd:/var/run/ircd:/bin/sh
17   gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
18   nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
19   libuuid:x:100:101::/var/lib/libuuid:/bin/sh
20   syslog:x:101:103::/home/syslog:/bin/false
21   messagebus:x:102:105::/var/run/dbus:/bin/false
22   colord:x:103:108:colord colour management daemon,,,:/var/lib/colord:/bin/false
23   lightdm:x:104:111:Light Display Manager:/var/lib/lightdm:/bin/false
24   whoopsie:x:105:114::/nonexistent:/bin/false
25   avahi-autoipd:x:106:117:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false
26   avahi:x:107:118:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
27   usbmux:x:108:46:usbmux daemon,,,:/home/usbmux:/bin/false
28   kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
29   pulse:x:110:119:PulseAudio daemon,,,:/var/run/pulse:/bin/false
30   rtkit:x:111:122:RealtimeKit,,,:/proc:/bin/false
31   speech-dispatcher:x:112:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
32   hplip:x:113:7:HPLIP system user,,,:/var/run/hplip:/bin/false
33   saned:x:114:123::/home/saned:/bin/false
34   ubuntu:x:999:999:Live session user,,,:/home/ubuntu:/bin/bash


每一行最后一项就是控制是否能登录的,/bin/false一定不能登录,/bin/bash或者/bin/sh应该可登录。

改完之后,修改密码,重启reboot,在用ssh登陆上了Linux,su - root,进入了根目录:

Last login: Sat Jun  8 18:45:31 2015 from 130.251.80.103
-bash-3.2$ ls
ls: .: Permission denied
-bash-3.2$ su - root
Password:
[root@cnaps2-oracle ~]# ls
anaconda-ks.cfg  giflib-utils-4.1.3-7.1.el5_3.1.i386.rpm


本文永久更新地址:http://www.linuxdiyf.com/linux/17494.html