oracle cloud ubuntu系统安装远程桌面 注意
首先 系统更新 apt update && upgrade
然后创建root密码 sodu passwd root 设置两边密码
然后su 转换到root超级用户,然后再cd /root
然后再用screen -R guo 创建一个不断连可恢复桌面 screen -list
最大的问题在于 iptables 以及服务的端口开放!
ip 源 0.0.0.0/0
源端口3389 目标端口 (默认不填 全部)
默认gnome桌面 大概2.6G的大小apt install ubuntu-desktop
apt install xrdp
然后设置 ufw allow 3389 防火墙放行端口
sudo iptables -I INPUT -p tcp --dport 3389 -j ACCEPT
然后reboot重启
systemctl status xrdp
出现下面信息表示ok
xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2024-03-24 22:30:05 UTC; 43min ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Process: 2357 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
Process: 2365 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2366 (xrdp)
Tasks: 2 (limit: 1044)
Memory: 19.3M
CGroup: /system.slice/xrdp.service
├─2366 /usr/sbin/xrdp
└─2412 /usr/sbin/xrdp
Mar 24 22:41:06 instance-20240324-2123 xrdp[3008]: (3008)(140488096614208)[DEBUG] Security layer: requested 3, selected 1
Mar 24 22:41:06 instance-20240324-2123 xrdp[3008]: (3008)(140488096614208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:10.0.0.22>
Mar 24 22:41:06 instance-20240324-2123 xrdp[2366]: (2366)(140488096614208)[INFO ] Socket 12: AF_INET6 connection received fro>
Mar 24 22:41:06 instance-20240324-2123 xrdp[2366]: (2366)(140488096614208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:10.0.0.22>
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[INFO ] Using default X.509 certificate: /etc/xrdp/>
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[INFO ] Using default X.509 key file: /etc/xrdp/key>
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[DEBUG] TLSv1.3 enabled
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[DEBUG] TLSv1.2 enabled
Mar 24 22:41:06 instance-20240324-2123 xrdp[3009]: (3009)(140488096614208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:10.0.0.22>
如果是3389 等等等 表示3389端口未开放