CentOS和Windows互相远程桌面方法
来源:互联网 发布:服装进销存软件排名 编辑:程序博客网 时间:2024/06/03 13:20
文章来源:http://blog.csdn.net/zlinsc/article/details/7392545
http://blog.csdn.net/ownfire/article/details/10188117
- yum install -y vnc-server
- vi /etc/sysconfig/vncservers
- vncserver
- vi /etc/sysconfig/iptables
VNC服务使用的端口号与桌面号相关,VNC使用TCP端口从5900开始,对应关系如下:
桌面号为“1” ---- 端口号为5901
桌面号为“2” ---- 端口号为5902
桌面号为“3” ---- 端口号为5903
……
- service iptables restart
- service vncserver restart
- yum install -y rdesktop
- rdesktop -a 16 x.x.x.x:3389 -u username -p password -f
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CentOS7下安装配置vncserver/vncviewer
http://hsuehwee.blog.51cto.com/10114119/1632211
以root用户运行以下命令来安装vncserver;
yum install tigervnc-server
同样运行以下命令来安装vncviewer;
yum install vnc
停止并禁用防火墙;
systemctl stop firewalld.service
systemctl disable firewalld.service
vncviewer基本上不用配置;
vncserver的配置,创建一个新的配置文件,以开启1号窗口为例(也可以同时开启多个窗口,修改数字即可),方法如下:
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
或者再增加一个窗口:
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
编辑/lib/systemd/system/vncserver@:1.service,设置用户root相关参数,最终内容如下:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=
/bin/sh
-c
'/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=
/sbin/runuser
-l root -c
"/usr/bin/vncserver %i"
PIDFile=
/root/
.vnc/%H%i.pid
ExecStop=
/bin/sh
-c
'/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
上述内容中最好设置为root用户,否则可能会看到以下报错:
vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (
/usr/lib/systemd/system/vncserver
@:1.service; enabled)
Active: failed (Result:
exit
-code) since Tue 2015-04-14 10:09:24 CST; 1min 36s ago
Process: 3258 ExecStart=
/sbin/runuser
-l sysadmin -c
/usr/bin/vncserver
%i (code=exited, status=1
/FAILURE
)
Process: 3254 ExecStartPre=
/bin/sh
-c
/usr/bin/vncserver
-
kill
%i >
/dev/null
2>&1 || : (code=exited, status=0
/SUCCESS
)
Apr 14 10:09:24 F1A-VMHOST-SWPE systemd[1]: Starting Remote desktop service (VNC)...
Apr 14 10:09:24 F1A-VMHOST-SWPE runuser[3258]: Password:
Apr 14 10:09:24 F1A-VMHOST-SWPE systemd[1]: vncserver@:1.service: control process exited, code=exited status=1
Apr 14 10:09:24 F1A-VMHOST-SWPE systemd[1]: Failed to start Remote desktop service (VNC).
Apr 14 10:09:24 F1A-VMHOST-SWPE systemd[1]: Unit vncserver@:1.service entered failed state.
Warning: Unit
file
changed on disk,
'systemctl daemon-reload'
recommended.
更新systemctl以使其生效;
systemctl daemon-reload
设置vncserver的密码;
vncpasswd root
按提示输入密码以及确认密码
启动该服务用来启用vnc的1号窗口;
systemctl start vncserver@:1.service 或者 vncserver :1
关闭1号窗口:
systemctl stop vncserver@:1.service 或者 vncserver -kill :1
设置为开机自动启动;
systemctl enable vncserver@:1.service
End.
Centos7远程桌面 vnc/vnc-server的设置
http://uchase.blog.51cto.com/880483/1545357
yum -y
install
tigervnc-server tigervnc
[root@localhost ~]
# cat /etc/sysconfig/vncservers
# THIS FILE HAS BEEN REPLACED BY /lib/systemd/system/vncserver@.service
[root@localhost ~]
# ll /lib/systemd/system/vncserver@.service
-rw-r--r--. 1 root root 1744 Jun 10 14:15
/lib/systemd/system/vncserver
@.service
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:<display>.service
# 2. Edit <USER> and vncserver parameters appropriately
# ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service
[root@localhost ~]
# cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=
/bin/sh
-c
'/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
ExecStart=
/sbin/runuser
-l root -c
"/usr/bin/vncserver :1 -geometry 1280x720 -depth 24"
PIDFile=
/root/
.vnc/%H%i.pid
ExecStop=
/bin/sh
-c
'/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl
enable
vncserver@:1.service
systemctl start vncserver@:1.service
[root@localhost system]
# cat /etc/sysconfig/iptables
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5901 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
cp
/lib/systemd/system/vncserver
@.service
/lib/systemd/system/vncserver
@:2.service
- CentOS和Windows互相远程桌面方法
- CentOS和Windows互相远程桌面方法
- CentOS和Window互相远程桌面方法
- CentOS和Window互相远程桌面方法
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面(图)
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- Windows 和 Linux 互相访问远程桌面
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- Windows和Linux互相访问远程桌面
- windows通过vnc远程桌面centos
- windows远程桌面管理CentOS 6.4
- windows远程桌面管理CentOS 6.4
- windows下远程桌面连接centos
- Windows/Linux 远程桌面访问CentOS
- windows和linux批处理互相调用的方法
- 博客开始日
- Android系统分享,微信SDK分享,ShareSdk分享
- Linux下安装RabbitMQ
- 黑马就业班第七天-servlet
- Spark加载PMML进行预测
- CentOS和Windows互相远程桌面方法
- boost库封装Thread
- winscp使用root登录时提示Permission denied的原因以及解决方案
- Android之RecyclerView
- 使用SwipeRefreshLayout和RecyclerView实现仿“简书”下拉刷新和上拉加载更多
- 1619-7 张良 十一月二十二号总结 [连续第五十三天]
- 一类递归式的另解
- 栈、队列、链表
- Android JNI开发