其实配置这个很简单,我以Debian9为例~其中又有点坑需要注意,只有自己趟过才知道。。。

我这里没有用系统自带的生成key的方式,如果想用系统自带方式,运行这条命令

ssh-keygen -t rsa -b 4096

系统会提示rsa key 存放位置,默认回车就好。完成后务必将   .ssh 文件夹下文件保存到本地!

运行命令  cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys    ( mv /root/.ssh/id_rsa.pub  /root/.ssh/authorized_keys  也可以)

chmod  600 /root/.ssh/authorized_keys     chmod 700  /root/.ssh/

vi /etc/ssh/sshd_config   修改 #PubkeyAuthentication yes   为 PubkeyAuthentication yes  (改为key方式登录,貌似不改也中,系统默认开启)

修改 PasswordAuthentication yes   为 PasswordAuthentication no  (禁用密码登录)

图省事有批量命令行~
cd /etc/ssh/

sed -i "/PasswordAuthentication no/c PasswordAuthentication no" sshd_config
sed -i "/RSAAuthentication no/c RSAAuthentication yes" sshd_config
sed -i "/PubkeyAuthentication no/c PubkeyAuthentication yes" sshd_config
sed -i "/PasswordAuthentication yes/c PasswordAuthentication no" sshd_config
sed -i "/RSAAuthentication yes/c RSAAuthentication yes" sshd_config
sed -i "/PubkeyAuthentication yes/c PubkeyAuthentication yes" sshd_config

无脑粘过去回车就好(笑

修改完需要重启ssh ,各个版本系统命令可能不同,我这里使用这个命令 service sshd restart  ,断开当前SSH链接重新登录就看到效果啦~

还有最后的一步,记得删除服务器上的 id_rsa  文件~
Bitvise SSH
最后的最后推荐使用putty或者Bitvise SSH ,简单方便

putty安装包

 
         

分享几个临时邮箱合集

临时邮箱合集,以下这些小编亲测可用,值得收藏哦 👉 Temp-Mail Temp-Mail 👉 AdGuard Temp Mail AdGuard Temp Mail 👉 Guerrilla Mail Guerrilla Mail 👉 Best T...

注册bgm账号提示“抱歉抱歉,帐户激活服务暂时不可用,请稍后再试”之解决办法

今天尝试注册https://bangumi.tv/,注册前半段没啥说的,很简单。结果跑去激活账户遇到了 “抱歉抱歉,帐户激活服务暂时不可用,请稍后再试”…一阵无语过...

本富科技锂电池充电器wifi连接密码是多少?

搜了一圈,在某音找到了答案。。。 默认wifi密码 BFKJ1688 登录页面 http://192.168.4.1 调试密码 666666 希望能帮到你哈

pantaloon 6月解密可获得游戏 Polterguys: Possession Party(附简易答案)

参与地址 pantaloon ,输入名字和邮箱地址join获取验证码登入。 送的游戏是这个Polterguys: Possession Party 简单说下答案哈。。。解密苦手表示猜了好久,也...

手动部署tuicV5到linux vps上

刚刚折腾了下,成功安装tuicV5到小鸡上2333 ,还别说,速度和hysteria比起来也不差,用起来还不错~ 我这里分享下我折腾安装全过程,其实还挺简单的 #新建个...

API切换cloudflare边缘证书颁发机构

已知cf边缘证书颁发机构有四种 cf自家 、Google、let‘s encrypt、setcigo。其中cf自家证书有效期最长,有一年,其余皆是三个月。。。 可以用命令行手动切换为...