Ubuntu 和Fedora 以roo用户自动登陆

来源:互联网 发布:mysql数据库实训 编辑:程序博客网 时间:2024/06/05 00:41

把Ubuntu安装在虚拟机里,每次启动都要输入账号密码,为了省事,让root自动登陆,如下:

 

1. root账户修改一个密码;

   在终端下输入sudo passwd root命令,终端会提示输入当前账户密码,正确输入后,再输入两次你想要为root账户赋予的密码即可。

 

 

2. 设置root账户自动登录;

 (1查看/etc/gdm/目录下是否存在custom.conf文件,如果存在,则直接跳到下一步,

 (2)如果不存在,则依次打开”System->àAdministrationà->Login Screen”(系统->系统管理->登陆窗口),点击“Unlock”后,修改LoginScreen Settings的某一项设置,比如Enable或者Disable一下“Log in as automatically”,然后关闭该窗口,再查看一下/etc/gdm/目录下,custom.conf文件应该就会存在了。


3. 编辑/etc/gdm/custom.conf文件,修改其中的AutomaticLoginEnableAutomaticLoginTimedLogin三项,具体如下所示:

[daemon]
AutomaticLoginEnable=true
这个修改为true
AutomaticLogin=root            
这个修改为root
TimedLoginEnable=false
TimedLogin=root                   
这个修改为root
TimedLoginDelay=10
DefaultSession=gnome

 

Fedora 以root登录:

1 vi /etc/pam.d/gdm 

 

把 auth  required ……    root  quiet  这行注释掉

 

2 vi /etc/pam.d/gdm-passwd

 

同上

3 vi /etc/gdm/custom.conf

在末尾增加以下:

[daemon]
 AutomaticLoginEnable=true
 AutomaticLogin=root

原创粉丝点击