要在Ubuntu Minimal上设置远程连接,您可以使用VNC或RDP。以下是详细步骤:
sudo apt update
sudo apt install x11vnc
x11vnc -storepasswd
touch ~/x11vnc.service
sudo 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`替换为您的用户名]
4. **在Windows上使用VNC Viewer连接**:
- 下载并安装VNC Viewer。在VNC Viewer中输入Ubuntu机器的IP地址,然后输入之前设置的密码即可连接。
### 使用RDP进行远程连接(适用于Ubuntu 24.04 LTS及以上版本)
1. **启用RDP远程登录**:
- 在Ubuntu的Settings → System → Remote Desktop中,选择Remote Login,然后点击“Unlock”按钮,输入当前用户的密码后,点击“Authenticate”按钮,完成设置。
2. **配置Desktop Sharing**:
- 在Remote Desktop设置中,选择Desktop Sharing,启动Desktop Sharing选项和Remote Control选项,并设置好从Windows使用远程桌面登录的用户名和密码。
3. **在Windows上使用远程桌面连接**:
- 启动“远程桌面连接”,填入Ubuntu机器的IP地址和端口号(通常是5900),点击“连接”按钮,接着输入设置中的用户名和密码,即可远程控制Ubuntu设备。
请注意,为了安全起见,建议使用SSH进行远程管理,而不是启用远程桌面功能,尤其是对于生产环境。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:ubuntu minimal远程桌面连接