最近把家里的台式机装上了Ubuntu 710,在无线路由上配置了动态DNS,打算配置成在单位也可以通过VNC控制家里的机器。之前论坛上有些这方面的文章,不过实际做起来的时候还是费了点劲,特写出来方便和握有一样需求的兄弟。
目前我发现有两种方式,可以实现远程VNC控制。
1.使用Ubuntu自带的远程桌面控制
在System->Preference->Remote Desktop
选上"Allow other users to view your desktop"和"Allow other users to control your desktop"
在Security上选上"Require the user to enter this password"并设一个密码就可以了。
这种方法的缺点是一定要主机上登陆Gnome,才可以。如果没能登陆时不能使用VNC。这样如果我远程控制机器重启就不能再控制了。
2.第二种方法比较麻烦,不过可以不用在主机上登录
确保第一种方法中的选项没选
在System->administration->login windows,在remote tab里面点Configure XDMCP。取消Honor indirect requests
sudo vi /etc/gdm/gdm.conf
找到[xdmcp]
设Enable=true
找到
# The greeter for xdmcp logins, usually you want a less graphically intensive
# greeter here so it's better to leave this with gdmlogin
# RemoteGreeter=/usr/lib/gdm/gdmlogin
取消# RemoteGreeter=/usr/lib/gdm/gdmlogin的注释
sudo apt-get install vnc4server xinetd
sudo vncpasswd /root/.vncpasswd
sudo chmod 666 /root/.vncpasswd
sudo vi /etc/xinetd.d/Xvnc
service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}
注意-extension XFIXES一定要有,如果没有就会报错。据说Edgy下的VNC4Server就不用加这句。
重起机器
用VNC客户端访问hostname:1就可以了
我在无线路由里面设了花生壳的动态DNS,并且把我的台式机设为DMZ主机。这样在单位访问我申请的免费花生壳二级域名就可以控制我的机器了。
当然我完全没考虑安全性,因为我现在只是玩玩,也没打算天天把家里的机器看着。欢迎高手补充安全方面的建议。
Ubuntu710上配置VNC(包括不用在主机上登录就可以远程VNC控制)
-
- 帖子: 32
- 注册时间: 2007-11-20 13:56
- chinafenghao
- 帖子: 234
- 注册时间: 2007-12-18 21:50
-
- 帖子: 32
- 注册时间: 2007-11-20 13:56