怎么禁止tiger-vnc,使用VNC时在服务器和客户端禁止互相拷贝数据
时间: 2024-03-27 07:38:58 浏览: 35
您可以通过修改 TigerVNC 的配置文件来禁用 VNC 客户端和服务器之间的剪贴板共享功能,从而避免数据的互相拷贝。具体操作如下:
1. 打开 TigerVNC 的配置文件 `/etc/vnc/config`(如果没有则创建该文件)。
2. 添加以下两行配置:
```
SecurityTypes=None
DisableClipboard=Yes
```
第一行 `SecurityTypes=None` 表示关闭所有连接的加密,第二行 `DisableClipboard=Yes` 表示禁用剪贴板共享功能。
3. 保存配置文件并退出。
4. 重启 TigerVNC 服务,使配置生效。
这样就成功禁用了 TigerVNC 的剪贴板共享功能,避免了数据的互相拷贝。
相关问题
python-vnc
根据引用[2],python-vnc是一个简单的VNC查看器,它使用了RFB、PyGame和扭曲。它支持多种编码方式,包括Hextile、CoRRE、RRE、RAW和CopyRect。由于它具有良好的图形性能,因此可以使用PyGame进行显示,但也可以在任何GUI系统中使用,因为代码是模块化的。
如果你想使用python-vnc,你可以按照以下步骤进行安装和使用:
1. 首先,确保你已经安装了Python和PyGame。
2. 克隆python-vnc的存储库并进入项目目录:
```
git clone https://github.com/ponty/python-vnc-viewer.git
cd python-vnc-viewer
```
3. 运行以下命令以查看VNC服务器的屏幕:
```
python vncviewer.py <VNC服务器地址>
```
请将<VNC服务器地址>替换为实际的VNC服务器地址。
这样,你就可以使用python-vnc来查看VNC服务器的屏幕了。
在centos7里面编写一个shell脚本,来限制VNC访问服务器的时候能拷贝centos的数据到VNC客户端。
好的,我可以帮您解决这个问题。首先,您需要在CentOS 7上安装VNC服务器。可以使用以下命令安装:
```
sudo yum install tigervnc-server
```
安装完成后,您需要创建一个用于启动VNC服务器的脚本。以下是一个示例脚本:
```
#!/bin/sh
# Set the VNC password
echo "mypassword" | vncpasswd -f > ~/.vnc/passwd
chmod 0600 ~/.vnc/passwd
# Start the VNC server
/usr/bin/vncserver :1 -geometry 1280x800 -depth 24 -dpi 96 -localhost
```
保存脚本并将文件权限设置为可执行:
```
chmod +x vnc.sh
```
现在,您需要创建一个iptables规则,以允许VNC客户端连接到服务器。请运行以下命令:
```
sudo iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
```
这将允许VNC客户端通过端口5901连接到服务器。
接下来,您需要安装和配置防火墙。以下是一个示例脚本:
```
#!/bin/sh
# Stop and disable firewalld
systemctl stop firewalld
systemctl disable firewalld
# Install iptables
yum install iptables-services -y
# Enable iptables
systemctl enable iptables
systemctl start iptables
# Allow SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Allow VNC
iptables -A INPUT -p tcp --dport 5901 -j ACCEPT
# Block everything else
iptables -A INPUT -j DROP
# Save the rules
service iptables save
```
保存脚本并将文件权限设置为可执行:
```
chmod +x firewall.sh
```
最后,您需要修改VNC配置文件,以禁用VNC客户端拷贝服务器数据的功能。请编辑以下文件:
```
~/.vnc/xstartup
```
找到以下行:
```
exec /etc/X11/xinit/xinitrc
```
并在其下方添加以下行:
```
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
```
保存文件并重启VNC服务器:
```
vncserver -kill :1
vncserver :1
```
现在,您的VNC服务器已准备好运行,并且可以限制VNC客户端拷贝服务器数据的功能。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)