2016-04-07 48 views
-1

我試圖登錄/部署到Ubuntu服務器是我的Rails應用程序,但突然今天上午我無法登錄那裏。無法SSH /部署任何東西到Ubuntu服務器

當我運行SSH ssh [email protected] -p 420並輸入密碼,我得到一個消息,密碼不正確,消息Permission denied, please try again.

當我嘗試部署一些代碼Capistrano的,我得到:

connection failed for: IP (Net::SSH::AuthenticationFailed: deployer) 

密碼也是正確的。

今天發生了這個問題,昨天是一切正常工作。 我仔細檢查了Capistrano的設置,但一切正確設置在那裏。

如何檢查該問題?從哪兒開始?它看起來像今天它停止工作。

編輯:

ssh -v XXX.XXX.XXX.XX 
OpenSSH_6.9p1, LibreSSL 2.1.7 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug1: Connecting to XXX.XXX.XXX.XX [107.170.160.89] port 22. 
debug1: connect to address XXX.XXX.XXX.XX port 22: Connection refused 
ssh: connect to host XXX.XXX.XXX.XX port 22: Connection refused 

EDIT2:

ssh adam$ ssh -v XXX.XXX.XXX.XX -p 420 
OpenSSH_6.9p1, LibreSSL 2.1.7 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug1: Connecting to XXX.XXX.XXX.XX [XXX.XXX.XXX.XX] port 420. 
debug1: Connection established. 
debug1: identity file /Users/adam/.ssh/id_rsa type 1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_rsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_dsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_dsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_ecdsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_ecdsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_ed25519 type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/adam/.ssh/id_ed25519-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.9 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-3ubuntu1 
debug1: match: OpenSSH_6.0p1 Debian-3ubuntu1 pat OpenSSH* compat 0x04000000 
debug1: Authenticating to 107.170.160.89:420 as 'adam' 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr [email protected] none 
debug1: kex: client->server aes128-ctr [email protected] none 
debug1: sending SSH2_MSG_KEX_ECDH_INIT 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ssh-rsa SHA256:yaXBElIwQJJKsNcGAE8hlDPmD26DyzgZ9ruwtbhs6vo 
debug1: Host '[XXX.XXX.XXX.XX]:420' is known and matches the RSA host key. 
debug1: Found key in /Users/adam/.ssh/known_hosts:3 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey,password 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /Users/adam/.ssh/id_rsa 
debug1: Authentications that can continue: publickey,password 
debug1: Trying private key: /Users/adam/.ssh/id_dsa 
debug1: Trying private key: /Users/adam/.ssh/id_ecdsa 
debug1: Trying private key: /Users/adam/.ssh/id_ed25519 
debug1: Next authentication method: password 
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password 
Permission denied, please try again. 

當我運行ssh -v [email protected] -p 420

謝謝。

+0

您可以嘗試在詳細模式下運行手動SSH命令以檢查嘗試的身份驗證模式 –

+0

@ yohann.martineau感謝您的評論。剛剛添加了'ssh -v'的輸出。 – user984621

+0

防火牆問題?你可以在這臺主機上運行nmap嗎? –

回答

0
debug1: Roaming not allowed by server 

先從旁邊開始,you should disable roaming or upgrade your ssh client

debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /Users/adam/.ssh/id_rsa 
debug1: Authentications that can continue: publickey,password 
debug1: Trying private key: /Users/adam/.ssh/id_dsa 
debug1: Trying private key: /Users/adam/.ssh/id_ecdsa 
debug1: Trying private key: /Users/adam/.ssh/id_ed25519 

線以上組顯示SSH客戶端所提供的關鍵id_rsa到服務器,但服務器沒有接受。最後三行代表ssh尋找的默認密鑰文件名,但在這種情況下沒有找到。

debug1: Next authentication method: password 
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password 

然後,您的ssh客戶端提示您輸入密碼並將其提供給服務器,但服務器不接受它。

從客戶端跟蹤中無法判斷爲什麼服務器突然拒絕您的密鑰和密碼。至少有六件事可能造成這種情況。爲了弄清楚,你必須進入服務器,並檢查系統日誌記錄sshd的消息。這些文件通常位於/var/log

隨口說說,這裏有一些事情,可能會導致這樣的:

  • 您正在嘗試登錄到已鎖定由管理員帳戶(或者密碼過期)。
  • 您嘗試登錄的帳戶不存在;它已被刪除,重命名,或者您拼錯了它。
  • 有權訪問帳戶的人更改了密碼並更改了授權密鑰列表。
  • IP地址已更改,並且您未連接到您認爲自己的計算機。
  • 黑客已進入服務器並進行了多項更改。
+0

謝謝@Kenster。 Ubuntu是否有類似默認密碼到期的內容? – user984621

+0

你應該考慮在[ubuntu.se]上提問Ubuntu特定的問題。 – Kenster

相關問題