linux 远程桌面的配置
root根用户登录在/root目录下
#rpm
-q vnc vnc-server查询已安装vnc的客户端和服务器端
vnc-4.1.1-36
vnc-server-4.1.1-36
#vi
/etc/sysconfig/vncservers将developer用户名加入vncservers文件中
如下所示:
#
VNCSERVERS="2:myusername"
VNCSERVERS="2:developer"
创建一个vnc的口令
#vncpasswd
Password:
Verify:
启动vnc服务
#sudo
/sbin/service vncserver
start
Starting VNC server:2:developer
[FAILED]
后来改为用户developer,并在/home/developer目录下创建vnc的口令
[developer@developer
~]$vncpasswd
Password:
Verifty:
$ls
-d .vnc
.vnc
$ls
.vnc
passwd
$/sbin/service
vncserver
start
Starting VNC server:2:developer
runuser:cannot set groups:Operation
not permitted [FAILED]
$sudo /sbin/service
vncserver start
developer is not in the sudorers file.This
incident will be reported.
退出仍用root用户
#sudo
/sbin/service vncserver
start
Starting VNC server:2:developer
xauth:creating new authority file
/home/developer/.Authority
New
‘developer.fw:2(developer)‘desktop is developer.fw:2
Creating
default startup script.
/home/developer/.vnc/xstartup
Starting
applications specified in
/home/developer/.vnc/xstartup
Log file
is /home/developer/.vnc/developer.fw:2.log
[OK]
这次成功了.
#cd
.vnc
(/home/developer/下)
#ls
developer.fw:2.log
developer.fw:2.pid
passwd xstartup
#vi
xstartup
下面两行的注释去掉。
unset
SESSION_MANAGER
exec
/etc/X11/xinit/xinitrc
保存退出
重启vncserver
#sudo
/sbin/service vncserver restart
Shutting
down VNC server:2:developer
[OK]
Starting VNC server:2:developer
New
‘developer.fw:2(developer)‘desktop is developer.fw:2
Starting
application specified in
/home/developer/.vnc/xstartup
Log file
is /home/developer/.vnc/developer.fw:2.log
[OK]
在本机上试连接到vncserver
#vncviewer
localhost:2
成功,打开了一个vnc窗口,输入口令,进入。
客户端的配置
如客户端为windows
,用putty或vnc客户端
客户端为linux:
1.vncviewer
localhost:2 在本机执行
2.用ssh
ssh -L
5901:localhost:5901 -l foo myserver
需在sudo vi
/etc/sysconfig/iptables中打开5901端口,
然后重启iptables
sudo
/sbin/service iptables restart
或者直接用ip地址ssh -L
5901:localhost:5901 -l foo 192.168.x.x
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。