赞
踩
apt update
apt install build-essential zlib1g-dev libssl-dev -y
apt install libpam0g-dev libselinux1-dev libkrb5-dev -y
mkdir /var/lib/sshd
chmod -R 700 /var/lib/sshd/
chown -R root:sys /var/lib/sshd/
cd /var/lib/sshd/
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/include/openssl --with-ssl-dir=/usr/local/lib --with-zlib --with-md5-passwords --with-pam --with-privsep-path=/var/lib/sshd
make && make install
如果这里没有允许密码登录,又没有配置免密,那就gg了
根据自己需要调整sshd配置文件,参考如下
vim /etc/ssh/sshd_config
PermitRootLogin yes #允许root登录,root用户必须添加
AuthorizedKeysFile .ssh/authorized_keys #指定公钥文件的保存位置以及名称
PasswordAuthentication yes #允许密码验证
UsePAM yes #PAM模块
UseDNS no #关闭dns检测
systemctl restart ssh
ssh -V
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。