Ubuntu710上配置VNC(包括不用在主机上登录就可以远程VNC控制)

上网、浏览、聊天、下载等
回复
apshai
帖子: 32
注册时间: 2007-11-20 13:56

Ubuntu710上配置VNC(包括不用在主机上登录就可以远程VNC控制)

#1

帖子 apshai » 2007-12-05 21:23

最近把家里的台式机装上了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主机。这样在单位访问我申请的免费花生壳二级域名就可以控制我的机器了。
当然我完全没考虑安全性,因为我现在只是玩玩,也没打算天天把家里的机器看着。欢迎高手补充安全方面的建议。
头像
chinafenghao
帖子: 234
注册时间: 2007-12-18 21:50

#2

帖子 chinafenghao » 2007-12-30 8:27

搂主的表达我怎么看不懂阿,连配置文件位位置我都不知道在哪,最好还是用标准格式算了
头像
moongod
帖子: 60
注册时间: 2007-09-17 10:17

#3

帖子 moongod » 2007-12-30 9:05

建议用高端口
apshai
帖子: 32
注册时间: 2007-11-20 13:56

#4

帖子 apshai » 2008-01-09 10:37

chinafenghao 写了:搂主的表达我怎么看不懂阿,连配置文件位位置我都不知道在哪,最好还是用标准格式算了
是哪部分不懂那?配置文件都是用的绝对路径,本身就说明的文件的位置。你按照我写的命令输入就对了。
tony988
帖子: 102
注册时间: 2006-04-16 15:48

#5

帖子 tony988 » 2008-01-10 22:03

很不错,照着楼主讲解的步骤做了,果然成功。

登陆的界面是debian的
x671
帖子: 24
注册时间: 2007-07-02 8:39

#6

帖子 x671 » 2008-01-12 21:31

x11vnc 更方便点吧?
回复