linux 安装防病毒软件clamav, 升级openssh

升级openssh到最新版

yum -y groupinstall 'Development Tools'
wget https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz

tar -xf openssh-8.4p1.tar.gz
cd openssh-8.4p1
./configure --prefix=/usr/local/openssh && make && make install
#报错解决:
#	configure: error: *** zlib.h missing – please install first or check config.log   ==> yum install -y zlib-devel
#	configure: error: *** working libcrypto not found, check config.log      yum install -y openssl-devel

#编译结果:centos6/7可以共用
[root@test-c6 ~]# tree /usr/local/openssh
/usr/local/openssh
├── bin
│   ├── scp
│   ├── sftp
│   ├── ssh
│   ├── ssh-add
│   ├── ssh-agent
│   ├── ssh-keygen
│   └── ssh-keyscan
├── etc
│   ├── moduli
│   ├── ssh_config
│   ├── sshd_config
│   ├── ssh_host_dsa_key
│   ├── ssh_host_dsa_key.pub
│   ├── ssh_host_ecdsa_key
│   ├── ssh_host_ecdsa_key.pub
│   ├── ssh_host_ed25519_key
│   ├── ssh_host_ed25519_key.pub
│   ├── ssh_host_rsa_key
│   └── ssh_host_rsa_key.pub
├── libexec
│   ├── sftp-server
│   ├── ssh-keysign
│   ├── ssh-pkcs11-helper
│   └── ssh-sk-helper
├── sbin
│   └── sshd
└── share
    └── man
        ├── man1
....

修改openssh的service文件

  • centos6: 最好先移除开机启动,再重新添加
sed -i.bak -e 's/\s\+do_rsa1_keygen/#do_rsa1_keygen/' \
      -e  's@/usr/bin@/usr/local/openssh/bin@g' \
    -e 's@/usr/sbin@/usr/local/openssh/sbin@g'  \
  -e 's@/etc/ssh@/usr/local/openssh/etc@g'  \
 /etc/init.d/sshd

sed -i '/#PermitRootLogin/aPermitRootLogin yes' /usr/local/openssh/etc/sshd_config
sed -i '/# PasswordAuthentication/aPasswordAuthentication yes' /usr/local/openssh/etc/sshd_config 
  • centos7: 最好先移除开机启动,再重新添加
sed -i.bak -e 's/^Wants/#Wants/' \
    	  -e ' s/^Type/#Type/'  \
   		 -e 's@/usr/sbin/sshd@/usr/local/openssh/sbin/sshd@' \
    /usr/lib/systemd/system/sshd.service   
    
sed -i '/#PermitRootLogin/aPermitRootLogin yes' /usr/local/openssh/etc/sshd_config
sed -i '/# PasswordAuthentication/aPasswordAuthentication yes' /usr/local/openssh/etc/sshd_config 

防毒软件clamav

安装:https://www.clamav.net/documents/installing-clamav
使用文档:https://www.clamav.net/documents/scanning#clamscan

yum install -y epel-release
yum install -y clamav
 
#setting up ClamAV’s official signatures升级病毒库
freshclam
#扫描病毒文件:并移动或删除
mkdir /var/lib/clamav/effected-files ; chown clam.clam /var/lib/clamav/effected-files
clamscan  --exclude='/proc|/sys'  --infected --log=/var/log/clamav/clamscan.log --move=/var/lib/clamav/effected-files -r /
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

根哥的博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值