Windows/Linux 远程桌面访问CentOS
2017-11-24 11:43
525 查看
转载请注明来源:http://blog.csdn.net/greenlight_74110/article/details/78623025
说明:
VNCSERVERS 这一行是配置在系统启动时启动几个 VNC server,上面的例子里运行了三个 VNC server,其中 john 在 display :1(对应于5901),july 在 display :2(对应于5902)。访问时使用xxx.xxx.xxx.xx:1或者xxx.xxx.xxx.xx:2访问即可。
VNCSERVERARGS 这三行,分别为 VNC server 1, 2配置启动参数,上面的例子里对 john 使用屏幕分辨率 1024×768,对 july 使用 800×600,24 色,不支持 tcp,不支持 http 连接,只能在本地测试访问。
假设允许用户“john”、“cat”远程登录,禁止用户“pig”远程登录。在文件末尾处添加:
获得相应用户的权限:
设置用户远程登录密码:
注:每个授予远程登录权限的用户,都要完成此项操作!
(option)或者也可以关闭防火墙
(option)查看防火墙状态
(option)关闭防火墙
(option)或者直接将服务器上的防火墙删除
完成以上操作后需要重启防火墙
其它
运行如下命令,可以看到3389端口:
linux下用remote desktop client且访问方式设置为xrdp,直接输ip地址即可访问。但如果要用vncviewer,记得在ip地址后面加端口号(可以是1,2….也可以是5901,5902,….)。
Windows/Linux 远程桌面访问CentOS
进入root
su
安装xrdp和vnc-server
yum install -y xrdp vnc-server
编辑 vncservers
在文件的末尾添加如下两行:vim /etc/sysconfig/vncservers VNCSERVERS="1:john" VNCSERVERARGS[1]="-geometry 1280x720" VNCSERVERS="2:july" VNCSERVERARGS[2]="-geometry 800×600 -depth 24 -nolisten tcp -nohttpd -localhost"
说明:
VNCSERVERS 这一行是配置在系统启动时启动几个 VNC server,上面的例子里运行了三个 VNC server,其中 john 在 display :1(对应于5901),july 在 display :2(对应于5902)。访问时使用xxx.xxx.xxx.xx:1或者xxx.xxx.xxx.xx:2访问即可。
VNCSERVERARGS 这三行,分别为 VNC server 1, 2配置启动参数,上面的例子里对 john 使用屏幕分辨率 1024×768,对 july 使用 800×600,24 色,不支持 tcp,不支持 http 连接,只能在本地测试访问。
编辑 /etc/group 文件
授予用户登录权限:vim /etc/group
假设允许用户“john”、“cat”远程登录,禁止用户“pig”远程登录。在文件末尾处添加:
john:250:john cat:x:250:cat pig:x:501:
设置用户远程登录密码
首先要回到相应的用户权限下。获得相应用户的权限:
su john
设置用户远程登录密码:
vncpasswd
注:每个授予远程登录权限的用户,都要完成此项操作!
设置防火墙
在iptables中添加端口列外-A INPUT -p tcp -m tcp --dport 5901:5903 -j ACCEPT #for the vncserver -A INPUT -m state --state NEW -m tcp -p tcp--dport 3389 -j ACCEPT #for the xrdp
(option)或者也可以关闭防火墙
(option)查看防火墙状态
service iptables status
(option)关闭防火墙
service iptables stop chkconfig off
(option)或者直接将服务器上的防火墙删除
chkconfig --del iptabels (服务内删除iptables)
完成以上操作后需要重启防火墙
service iptables restart
加入开机自启
设置让 xrdp 和 vncserver 随开机加载启动。chkconfig xrdp on chkconfig vncserver on
维护vncserver
打开/关闭端口vncserver :1 vncserver -kill :1
其它
service vncserver status service vncserver start service vncserver stop service vncserver restart
维护xrdp
service xrdp status service xrdp start service xrdp stop
运行如下命令,可以看到3389端口:
netstat -tnlp |grep xrdp
远程登录
windows下在“运行”中输入mstsc,即可打开远程连接程序linux下用remote desktop client且访问方式设置为xrdp,直接输ip地址即可访问。但如果要用vncviewer,记得在ip地址后面加端口号(可以是1,2….也可以是5901,5902,….)。
相关文章推荐
- linux通过远程桌面访问windows
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面(图)
- windows远程桌面访问Linux系统 (XRDP+VNC )
- Linux 远程桌面 访问 WIndows
- 在windows下远程访问linux桌面的配置方法
- Windows和Linux互相访问远程桌面
- centos7 通过kvm+vnc 实现远程桌面虚拟化和创建windows、Linux虚拟机
- Linux有问必答:如何在VPS上安装和访问CentOS 7远程桌面
- Windows和Linux互相访问远程桌面
- Windows 远程桌面访问CentOS6.5(XRDP方式)
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- Windows 和 Linux 互相访问远程桌面
- CentOS 6.5 服务端配置vnc-server windows客户端远程桌面访问CentOS 6.5
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- 在linux下开远程桌面访问windows的解决方法
- Windows和Linux远程桌面相互访问