分类 Linux 下的文章

1.需要修改ssh源文件 version.h 中 define SSH_VERSION的内容

#define SSH_VERSION     "OpenSSH_Welcome"

#define SSH_PORTABLE    "p1"
#define SSH_RELEASE     SSH_VERSION SSH_PORTABLE

2.编译源码安装Openssh
3.重启sshd服务

$ systemctl daemon-reload
$ systemctl restart sshd.service

4.验证是否成功

$ telnet localhost 22
Trying ::1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_Welcome

漏洞名称: ICMP timestamp请求响应漏洞

CVE编号: CVE-1999-0524

风险等级: 低 ,协议ICMP

详细描述: 远程主机会回复ICMP_TIMESTAMP查询并返回它们系统的当前时间。这可能允许攻击者攻击一些基于时间认证的协议。

解决办法: NSFOCUS建议您采取以下措施以降低威胁:在您的防火墙上过滤外来的ICMP timestamp(类型 13)报文以及外出的ICMP timestamp回复报文。

防火墙增加规则
iptables -A INPUT -p ICMP --icmp-type timestamp-request -j DROP
iptables -A INPUT -p ICMP --icmp-type timestamp-reply -j DROP

漏洞名称: 允许Traceroute探测

CVE编号: CVE-1999-0633

风险等级: 低 ,协议ICMP

详细描述: 本插件使用Traceroute探测来获取扫描器与远程主机之间的路由信息。攻击者也可以利用这些信息来了解目标网络的网络拓扑。

解决办法: 在防火墙出入站规则中禁用echo-reply(type 0)、time-exceeded(type 11)、destination-unreachable(type 3)类型的ICMP包。

防火墙增加规则
iptables -A INPUT -p ICMP --icmp-type echo-reply -j DROP  
iptables -A OUTPUT -p ICMP --icmp-type echo-reply -j DROP  
iptables -A INPUT -p ICMP --icmp-type time-exceeded -j DROP  
iptables -A OUTPUT -p ICMP --icmp-type time-exceeded -j DROP  
iptables -A INPUT -p ICMP --icmp-type destination-unreachable -j DROP  
iptables -A OUTPUT -p ICMP --icmp-type destination-unreachable -j DROP
查看防火墙策略
iptables -L -n

1.OpenSSL版本升级

https://computingforgeeks.com/how-to-install-openssl-1-1-on-centos-rhel-7/

1.1 安装依赖

$ sudo yum -y groupinstall "Development Tools"

1.2 下载openssl且编译

$ wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
$ tar xvf openssl-1.1.1w.tar.gz
$ cd openssl-1.1.1w
$ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1w (0x1010117fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************

- 阅读剩余部分 -

前提:在Synology NAS共享文件中NFS权限标签页新增NFS规则,输入需要访问NFS共享的系统的IP。其余保留默认选项并单击“确定”。

系统IP必须同上面设置的IP相同

1.Install NFS common tools

sudo apt-get update
sudo apt-get install nfs-common -y

2.创建挂载目录

sudo mkdir -p /nfs/temp

3.临时挂载

sudo mount 192.168.1.10:/volume1/Temp /nfs/temp
# 卸载
sudo umount /nfs/temp

4.持久挂载

重启后自动挂载
编辑文件/etc/fstab
192.168.1.10:/volume1/Temp         /nfs/temp nfs     defaults        0       0

5.测试权限

sudo chown -R user:group /nfs/temp
sudo chmod -R 755 /nfs/temp
# check permissions with stat
stat /nfs/temp
您是第 68056 位访客