标签搜索

cento6.7升级openssh

cicaba
2022-03-21 / 0 评论 / 4 阅读 / 正在检测是否收录...

telent
参考连接:https://www.hangge.com/blog/cache/detail_2935.html
下载依赖
安装依赖 rpm -ivh *.rpm --nodeps --force
修改配置 vi /etc/xinetd.d/telnet
启动 service xinetd restart
防火墙 firewall-cmd --permanent --zone=public --add-port=23/tcp
重启 systemctl reloa dfirewalld

openssh
参考文档 https://developer.aliyun.com/article/661357
下载好相关文件
删除相关文件
mv /etc/ssh /etc/ssh.old
mv /etc/init.d/sshd /etc/init.d/sshd.old
install -v -m700 -d /var/lib/sshd
chown -v root:sys /var/lib/sshd
groupadd -g 50 sshd
useradd -c 'sshd PrivSep' -d /var/lib/sshd -g sshd -s /bin/false -u 50 sshd

编译进入openssh目录
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-openssl-includes=/usr --with-privsep-path=/var/lib/sshd

安装
make && make install
install -v -m755 contrib/ssh-copy-id /usr/bin
install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1
install -v -m755 -d /usr/share/doc/openssh-8.9p1
install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.9p1
ssh -V
echo 'X11Forwarding yes' >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
cp -p contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
service sshd restart

密码无法登录. 修改配置文件 vi /etc/ssh/sshd_config UsePAM yes 重启 service sshd restart

0

评论 (0)

取消