做初中物理题目的网站/推广一次多少钱
现在公司要求服务器不允许上传下载文件,也不允许复制之类的。领导说用VNC,然后查了一下,VNC是可以复制的(可以添加相关选项禁用复制功能),另外VNC账号要使用LDAP认证还不是太方便。
后来找了一下,发现 xrdp 这个软件。这个其实就是一个远程桌面,在WIN下可以直接用 mstsc连接。
它支持LDAP认证。然后核心还是用的VNC。
因为要禁用复制粘贴,然后默认这个是可以的。直接把
1 | sesman /chansrv/clipboard .h |
中定义的函数,在
1 | sesman /chansrv/chansrv .c |
中全部注释即可。然后再编译...
LDAP认证:
centos5、centos6 直接复制一下就OK
1 | cp /etc/pam .d /system-auth-ac /etc/pam .d /xrdp-sesman |
ubuntu:
1 2 3 4 5 6 | vi /etc/pam .d /xrdp-sesman #%PAM-1.0 @include common-auth @include common-account @include common-session @include common-password |
另外建议把 /etc/xrdp/xrdp.ini 中 其它配置删除,仅使用 sesman-Xvnc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | [globals] bitmap_cache= yes bitmap_compression= yes port=3389 crypt_level=low channel_code=1 max_bpp=24 #black=000000 #grey=d6d3ce #dark_grey=808080 #blue=08246b #dark_blue=08246b #white=ffffff #red=ff0000 #green=00ff00 #background=626c72 [xrdp1] name=sesman-Xvnc lib=libvnc.so username=ask password=ask ip=127.0.0.1 port=-1 |
还有iptables 相关设置。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #!/bin/bash # INIT CHAIN iptables -F iptables -X iptables -Z iptables -F -t nat iptables -X -t nat iptables -Z -t nat iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD ACCEPT #INPUT CHAIN iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT # Docker Centos 6 ERROR "FATAL: Could not load /lib/modules/4.4.0-45-generic/modules.dep: No such file or directory" iptables -A INPUT -p tcp -m multiport --dport 22,3389 -m state --state NEW -j ACCEPT iptables -A INPUT -p udp -s 192.168.10.4 --sport 53 -j ACCEPT # DNS iptables -A INPUT -p udp -s 192.168.10.5 --sport 123 -j ACCEPT # NTPDATE iptables -A INPUT -p icmp --icmp- type echo -request -j ACCEPT iptables -A INPUT -p icmp --icmp- type echo -reply -j ACCEPT #OUTPUT CHAIN iptables -A OUTPUT -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -p udp -d 192.168.10.4 --dport 53 -j ACCEPT # DNS iptables -A OUTPUT -p udp -d 192.168.10.5 --dport 123 -j ACCEPT # NTPDATE iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT # Xrdp iptables -A OUTPUT -p icmp --icmp- type echo -request -j ACCEPT iptables -A OUTPUT -p icmp --icmp- type echo -reply -j ACCEPT |
上面的 -m multiport 在Docker Centos 6 中报错,然后拆成,即可
1 2 | iptables -A INPUT -p tcp --dport 3389 -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT |
SSH仅允许指定用户或者组登录:
1 2 3 | vi /etc/ssh/sshd_config # add AllowUsers root test1 test2 AllowGroups root test1 test2 |
目前这样测试OK。
本文转自 nonono11 51CTO博客,原文链接:http://blog.51cto.com/abian/1877805,如需转载请自行联系原作者