OpenSSH升级版本(7.4升级到9)
ssh -V ### 1.为防止安装失败,无法用ssh做远程连接,因此先安装telnet防一手 yum -y install telnet* systemctl enable telnet.socket systemctl start telnet.socket mv /etc/securetty /etc/securetty.bak firewall-cmd --zone=public --add-port=23/tcp --permanent systemctl restart firewalld.service firewall-cmd --zone=public --list-ports ### 2.安装依赖包 yum -y install zlib* yum -y install pam-* yum -y install gcc yum -y install openssl-devel ### 3.备份原有yum安装的ssh服务版本 mv /etc/ssh /etc/ssh.bak mv /usr/bin/ssh /usr/bin/ssh.bak mv /usr/sbin/sshd /usr/sbin/sshd.bak ### 4.安装openssh wget https://mirrors.aliyun.com/openssh/portable/openssh-9.3p1.tar.gz tar -zxvf openssh-9.3p1.tar.gz cd openssh-9.3p1 ./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local/ssl make && make install ### 5.卸载由yum安装的openssh yum remove openssh ### 6.修改配置 **启动前要将新生成的sshd_config修改以下几个地方** vi /usr/local/openssh/etc/sshd_config #PermitRootLogin prohibit-password PermitRootLogin yes #PubkeyAuthentication yes PubkeyAuthentication yes #PasswordAuthentication yes PasswordAuthentication yes **复制文件到相应系统文件夹** cp /root/openssh-9.3p1/contrib/redhat/sshd.init /etc/init.d/sshd chkconfig --add sshd cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd cp /usr/local/openssh/bin/ssh /usr/bin/ssh cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen cp /usr/local/openssh/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub #启动 systemctl start sshd.service #查看状态 systemctl status sshd.service 安装完成后使用xshell之类的工具登录,发现在输入密码后被拒绝,用下面方法解决 (1)考虑是否是selinux启用了策略,将/etc/selinux/config 文件中的SELINUX=enforcing 修改为 SELINUX=disabled (2)setenforce 0 ssh -V
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
2018-04-23 thinkphp5 tp5 会话控制 session 登录 退出 检查检验登录 判断是否应该跳转到上次url
2018-04-23 微信 模板消息