1.镜像装ubuntu20系统,配置root账户
新系统肯定是新非root用户登录的,在这个用户下输入,创建root用户密码
sudo passwd
1.输入当前用户密码
2.root用户密码
3.重复root用户密码。
2.设置可视化界面root可登录且自动登录
需要配置文件有:50-unity-greeter.comf; gdm-autologin; gam-password; .profile; custom.conf文件
这里可使用工具不限于vi,vim,gedit,或者直接文件目录直接修改(非root用户还是用命令行修改)
以vim为例:(为防止后续出错,将文件权限都打开,不开可能也不影响)
sudo chmod 777 /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
sudo chmod 777 /etc/pam.d/gdm-autologin
sudo chmod 777 /etc/pam.d/gdm-password
sudo chmod 777 /root/.profile
sudo chmod 777 /etc/gdm3/custom.conf
编辑第一个文件
sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
在末尾添加(允许手动登录,允许root登录)
greeter-show-manual-login=true
all-guest=false
编辑第二,三个文件(注释掉第二行红框的内容)
sudo vim /etc/pam.d/gdm-autologin
sudo vim /etc/pam.d/gdm-password
编辑第四个文件
sudo vim /root/.profile
尾部加上
tty -s&&mesg n || true
编辑第五个文件,主要的就是把下面AutomaticLoginEnable,,AutomaticLogin,TimedLogin,AutomaticLogin设置对即可。
sudo vim /etc/gdm3/custom.conf
TimedLoginEnable=false
AutomaticLoginEnable=true #设为true
TimedLogin=root #设成root
AutomaticLogin=root #设成root
TimedLoginDelay=10
AutomaticLoginEnable=true #设为true
AutomaticLogin=root #设为root
至此开机仅root已完成,向日葵远程界面安装后一般是开机自启服务的,如果ssh可以登录向日葵登录不了一般是网络原因造成的;如果向日葵服务先于网络服务启动可能要多等180秒后才能连上,本机就是这种情况,具体自启服务先后顺序如何更改不在此次研究范围中,网络ping的通,网页打不开是dns引起,需要手动设置114.114.114.114,其他目前没遇到什么问题,完结。