要在Ubuntu Minimal系统上实现远程访问,您可以使用以下方法之一:
sudo apt update
sudo apt install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal lightdm x11vnc
x11vnc -storepasswd
密码将保存在 ~/.vnc/passwd
文件中。
创建一个 x11vnc.service
文件并将其放置在 /lib/systemd/system/
目录下:
touch ~/x11vnc.service
sudo bash -c 'cat <<EOF > ~/x11vnc.service
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/your_username/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /home/your_username/.vnc/passwd -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
EOF'
sudo mv ~/x11vnc.service /lib/systemd/system/
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc.service
请将 your_username
替换为您的用户名。
journalctl -ef -u x11vnc.service | grep 5900
在 VNC Viewer 中输入您的 Ubuntu 机器的 IP 地址,然后输入在步骤 3 中设置的密码。
sudo apt update
sudo apt install xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp
sudo passwd root
在 Windows 的远程桌面客户端中输入您的 Ubuntu 机器的 IP 地址,然后输入用户名和密码进行连接。
以上就是在 Ubuntu Minimal 系统上实现远程访问的两种方法。您可以根据自己的需求选择合适的方法。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:Ubuntu Minimal如何远程访问