美文网首页
openssh升级

openssh升级

作者: 这货不是王马勺 | 来源:发表于2023-11-09 10:56 被阅读0次

    参考如下过程

    cp -rp /etc/ssh /etc/ssh.bak
    yum install -y openssl openssl-devel gcc gcc-c++ make zlib-devel
    rpm -e   --nodeps `rpm -qa | grep openssh`
    cd /root
    wget https://mirrors.******.com/package/ssh/openssh-9.5p1.tar.gz --no-check-certificate
    
    tar -zxvf openssh-9.5p1.tar.gz -C ./
    cd openssh-9.5p1/
    ./configure --prefix=/usr/ --sysconfdir=/etc/ssh/ --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man/
    make && make install
    cat >/usr/lib/systemd/system/sshd.service<<EOF
    [Unit]
    Description=OpenSSH server daemon
    Documentation=man:sshd(8) man:sshd_config(5)
    After=network.target
    [Service]
    ExecStart=/usr/sbin/sshd
    KillMode=process
    [Install]
    WantedBy=multi-user.target
    EOF
    sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin  yes/g' /etc/ssh/sshd_config
    chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key
    systemctl enable sshd
    systemctl start sshd
    

    相关文章

      网友评论

          本文标题:openssh升级

          本文链接:https://www.haomeiwen.com/subject/nmycwdtx.html