阿里云

安装桌面环境

#更新软件库

apt-get update

升级软件

apt-get upgrade

安装Ubuntu桌面系统

apt install ubuntu-desktop

禁用guest session 使用root

sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
按 i 进入编辑模式,在末尾添加如下两行,然后按ESC+输入:wq保存编辑

greeter-show-manual-login=true //允许切换用户登陆
allow-guest=false //禁用Guest

保存后重启

解决root登录警告

sudo vi /root/.profile

按 i 进入编辑模式,在末尾添加如下两行,然后按ESC+输入:wq保存编辑

将mesg n 替换为tty -s && mesg n
完整代码如下:

#~/.profile: executed by Bourne-compatible login shells.

if [ “$BASH” ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi

tty -s && mesg n || true
保存后重启

配置远程登录

安装Xface
sudo apt-get -y install xfce4 xrdp vnc4server

配置xfce4桌面会话文件

echo xfce4-session>.xsession
cat .xsession

重启

进行桌面连接

阿里云
输入 公ip
用户名 root
远程登录密码
即可登录