無法透過 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/設定檔

SSH 狀態:

SSH 狀態:

檢查防火牆運作狀態:

檢查防火牆運作狀態:

登入

[ssh-複製-id]

答案1

您的debian使用者沒有設定 shell。

透過以下方式設置外殼:

$ sudo chsh -s /bin/bash debian

相關內容