Ubuntu建立root用户并且设置开机启动

打开 Ubuntu 终端, 有三种方法: ○1 桌面虚拟终端 在菜单中找,也可以直接运行 gnome-terminal 或 xterm 等。 ○2 按制台终端 取消 gdm 服务,同时按 Ctrl+Alt+F2 组合键。 恢复桌面系统,按 Ctrl+Alt+F7 组合键。 ○3 远程登录 在物理机中运行相应工具,远程登录。

○1 建立 root 用户 sundm@ubuntu:/$ sudo passwd root [sudo] password for sundm: //输入当前用户密码 Enter new UNIX password: //输入 root 密码 Retype new UNIX password: //确认 root 密码 passwd: password updated successfully sundm@ubuntu:/$ su //切换至 root 用户 Password: root@ubuntu:/// //命令进入 root 用户了 ○2 设置 root 用户自动登录 gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 添加以下代码: [SeatDefaults] autologin-guest=false //不允许 guest 登录 autologin-user=root user-session=ubuntu greeter-show-manual-login=true //手工输入登录系统的用户名和密码 在刚修改完 root 权限自动登录后,发现开机出现以下提示: Error found when loading /root/.profile stdin:is not a tty 需要修改 profile 文件。 gedit /root/.profile 打开文件后找到“mesg n” ,将其更改为“tty -s && mesg n” 。

经验分享 程序员 微信小程序 职场和发展