Ubuntu为了系统安全,root账号的密码是随机的,如果临时需要提升至root权限以执行一些命令,需要使用sudo命令。公司里有几台使用Ubuntu的机器,因为使用者不固定,并且执行程序时需要使用到root权限,所以需要将这几台机器配置为自动登录到root账户。查阅了相关资料后,可以通过以下两步来实现这个目的:
1. 为root账户修改一个密码; 在终端下输入"sudo passwd root"命令,终端会提示输入当前账户密码,正确输入后,再输入两次你想要为root账户赋予的密码即可。 2. 设置root账户自动登录; 编辑/etc/gdm/custom.conf文件,修改其中的AutomaticLoginEnable,AutomaticLogin,TimedLogin三项,具体如下所示: [daemon] AutomaticLoginEnable=true 这个修改为true AutomaticLogin=root 这个修改为root TimedLoginEnable=false TimedLogin=root 这个修改为root TimedLoginDelay=10 DefaultSession=gnome |
|