无法通过 SSH 登录

无法通过 SSH 登录

我在 的帮助下生成了公钥和私钥ssh-keygen

现在我想添加public_key到服务器,要添加public_key到服务器,首先我想登录到服务器,但我无法登录到服务器并出现错误permission denied(publickey,password)

如何登录服务器以及如何将public_key内容复制到服务器端authorized_key文件中。

/etc/ssh/sshd_config

Port 22, 
Protocol 2,
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key 
UsePrivilegeSeparation yes
KeyRegenerationInterval yes
ServerKeyBits 768
SyslogFacility AUTH
Loglevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubketAuthentication yes
HostbasedAuthentication no
IgnoreRhosts yes
RhostsRSAAuthentication no
PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes

内容/var/log/auth.log

ssh-复制-id

内容/etc/passwd

/etc/passwd 文件

内容auth.log

认证日志

尝试运行:ssh -vv [email protected]

ssh -vv debian@192.168.7.2

内容/.ssh/config file

/.ssh/config 文件

SSH 状态:

SSH 状态:

检查防火墙运行状态:

检查防火墙运行状态:

登录

[ssh-复制-id]

答案1

您的debian用户没有设置 shell。

通过以下方式设置 shell:

$ sudo chsh -s /bin/bash debian

相关内容