我有私钥可以用,但是我只想输入密码。
注意不是服务端 sshd 的配置,是在客户端。 在 .ssh/id_rsa 存在的时候,我依然想用密码登陆。怎么办?
Linux ssh 运维
可以通过该命令: ssh -ND 4711 user@172.168.1.103 不过首先得确保远程机器 /etc/ssh/sshd_config 里 PasswordAuthentication yes 一般默认是开启的
ssh -ND 4711 user@172.168.1.103
/etc/ssh/sshd_config
PasswordAuthentication yes
sshd_config 中的 PubkeyAuthentication 设为 no 另外你还可以把 AuthenticationMethods 设为 publickey,password publickey,keyboard-interactive 这样你就同时需要私钥和密码才能登录。
sshd_config
PubkeyAuthentication
no
AuthenticationMethods
publickey,password publickey,keyboard-interactive
具体设置看 SSHD_CONFIG(5)
SSHD_CONFIG(5)
在客户端,你可以在~/.ssh/config文件里加入:
PreferredAuthentications password
注意不是 = 是空格
=
怎样在 ssh 命令行中使用 rz/sz 传输数据?
ssh 怎样自动重连(即便是服务器重启)?
如何加快ping的频率?
请问如何为Centos添加用户并赋予SSH权限?
linux中ssh的config怎么配置可以省略输入密码?
用git管理的django项目如何部署和管理?
学习Linux的几点建议
最先进的战舰也使用Linux