I tried to log in/deploy something to a Ubuntu server is my Rails app, but suddenly this morning I ma unable to log in there.
When I run the SSH ssh deployer#IP -p 420 and enter the password, I get a message that the password is incorrect and the message Permission denied, please try again.
When I try to deploy some code with Capistrano, I get:
connection failed for: IP (Net::SSH::AuthenticationFailed: deployer)
Password is, again, correct.
This issue occurred today, yesterday was everything working perfectly.
I double checked the Capistrano set up, but everything is correctly set up there.
How to inspect the issue? Where to start? It simply looks like today it stopped working.
EDIT:
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 umac-64#openssh.com none
debug1: kex: client->server aes128-ctr umac-64#openssh.com 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
deployer#XXX.XXX.XXX.XX's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
when I run ssh -v deployer#XXX.XXX.XXX.XX -p 420
Thank you.
debug1: Roaming not allowed by server
To start with an aside, 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
The above group of lines shows that your ssh client offered the key id_rsa to the server, but the server didn't accept it. The last three lines refer to default key filenames which ssh looks for, but didn't find in this case.
debug1: Next authentication method: password
deployer#XXX.XXX.XXX.XX's password:
debug1: Authentications that can continue: publickey,password
Then, your ssh client prompted you for a password and offered it to the server, but the server didn't accept it.
It's not possible to tell from the client trace why the server is suddenly refusing your key and password. There are probably at least half a dozen things that could cause this. To find out for sure, you'd have to get into the server and check the syslog logs for messages from sshd. These files are normally located in /var/log.
Offhand, here are some of the things that could be causing this:
The account which you're trying to log into has been locked by the administrator (or maybe the password expired).
The account which you're trying to log into doesn't exist; it's been removed, renamed, or you're misspelling it.
Someone with access to the account changed its password and altered the list of authorized keys.
IP addresses have changed, and you're not connecting to the computer which you think you are.
Hackers have gotten into the server and made any of a number of changes.
Related
I've built a Rails app which I want to deploy on heroku. I can run the web application on my local machine.
When I type the command : git push heroku master I get the following error message:
git push heroku master
ssh: connect to host heruko.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It seems to be an connection error. So I tried:
sh -v git#heroku.com
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: Connection established.
debug1: identity file /Users/myname/.ssh/id_rsa type 1
debug1: identity file /Users/myname/.ssh/id_rsa-cert type -1
debug1: identity file /Users/myname/.ssh/id_dsa type -1
debug1: identity file /Users/myname/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version endosome
debug1: no match: endosome
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /Users/myname/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/myname/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to heroku.com ([50.19.85.156]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = fr_FR.UTF-8
PTY allocation request failed on channel 0
shell request failed on channel 0
Here I can see the authentication is successful. I don't understand why I cannot push on heroku and deploy my application.
Here are remote :
git remote -v
heroku git#heruko.com:aqueous-plateau-17182.git (fetch)
heroku git#heruko.com:aqueous-plateau-17182.git (push)
origin git#bitbucket.org:pracede/hubapp.git (fetch)
origin git#bitbucket.org:pracede/hubapp.git (push)
Do you have an idea or a suggestion?
You have a typo in your git remotes:
git#heruko.com:aqueous-plateau-17182.git
It's heroku, not heruko :)
So i have tried everything i can find and im panicing so please help
When i do a fresh heroku create on my app it genirates fine
then i go to git push heroku master.
I get the error
Jacks-MacBook-Air:morph jacksharville$ git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
i have tried clear the keys with heroku keys:clear
I have then tried running heroku keys:add
It still comes up with the same error.
if i run ssh -vT git#heroku.com
this is the output
Jacks-MacBook-Air:morph jacksharville$ ssh -vT git#heroku.com
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to heroku.com [50.19.85.154] port 22.
debug1: Connection established.
debug1: identity file /Users/jacksharville/.ssh/id_rsa type 1
debug1: identity file /Users/jacksharville/.ssh/id_rsa-cert type -1
debug1: identity file /Users/jacksharville/.ssh/id_dsa type -1
debug1: identity file /Users/jacksharville/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version endosome
debug1: no match: endosome
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /Users/jacksharville/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/jacksharville/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to heroku.com ([194.168.4.123]:53).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
shell request failed on channel 0
What happens if you do heroku auth:login and then log in with your credentials?
Do you still get the same error?
There is no way to fix this easily. The way i ended up getting around it is creating a new app and dragging assets across.
I get an error when I run push heroku master:
The authenticity of host 'heroku.com (50.19.85.154)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: The remote end hung up unexpectedly
When I run ssh -v git#heroku.com, I get
OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: Connection established.
debug1: identity file /Users/Sabir/.ssh/id_rsa type 1
debug1: identity file /Users/Sabir/.ssh/id_rsa-cert type -1
debug1: identity file /Users/Sabir/.ssh/id_dsa type -1
debug1: identity file /Users/Sabir/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version Twisted
debug1: no match: Twisted
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad
The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
I haven't been able to solve the problem. Any idea?
Looks like your keys might be compromised in some way. Try re-adding them?
run this:
heroku keys:add ~/.ssh/id_rsa.pub
id_rsa.pub might have a different name on your machine. Check out your .ssh dir before running.
I was first using multiple ssh keys using a config file. Now the need for multiple keys went away and I deleted those keys+the the config file.
After this github gives me the permission denied (publickey) error when trying to push.
I thought It might be a key problem so I deleted the ssh keys in my ~/.ssh/ folder and generated them again following the Github manual. I also added the public key again to the ssh-keys within the github account settings.
This does not solve the problem.
The next thing I did was this:
eval $(ssh-agent) > /dev/null
ssh-add ~/.ssh/id_rsa
After doing this I can do a git push. They do ask me to enter my passphrase which I find weird since I normally do not have to do this.
After closing the cmd windows they keep asking for my passphrase when trying to push again.
After a restart I have to do the whole ssh agent thing again since I get the public error again.
Can somebody help me fix this problem?
I am running windows 8.1 and installed Ruby on Rails using railsinstaller. This also included Github.
Full errors I am getting:
$ git push
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
and
$ssh -vT git#github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [192.30.252.130] port 22.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version libssh
debug1: no match: libssh-0.6.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug1: Trying private key: /.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
I think the problem lies in the fact that the ssh manager does not remember the key. How do I set this up? Railsinstaller did this for me in the first install. I messed this up somewhere and I need to have it working again like before.
I have GIT server hosted on separate Linux server. I have SSH RSA keys without password.
I am able to connect to GIT Server with Xcode and all operations are working properly in Source Control through Xcode 5.0.2.
I have OS X Server install in my local machine.
Following is my OS X Server setup configuration:
Added the Remote Repository as : ssh://myuser#XXXXXXX.XXXX.com:22/iphone_project
I had make sure that my public is correct in OS X Server for SSH. I had copy paste SSH pub key from /.ssh/id_rsa.pub to OS X Server.
.
Cloning into 'ssh_XXXX_XXXX_XXX_com_22_mtp_iphone'...
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to XXXXXX.XXXXXX.com [172.20.10.65] port 22.
debug1: Connection established.
Could not create directory '/var/teamsserver/.ssh'.
debug1: identity file /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa type 1
debug1: identity file /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 26:70:37:3a:56:bd:17:bd:9d:6a:14:c0:21:23:65:1c
debug1: Host 'XXXXXX.XXXX.com' is known and matches the RSA host key.
debug1: Found key in /Library/Server/Xcode/Config/ssh_known_hosts:1
debug1: ssh_rsa_verify: signature correct
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,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Miscellaneous failure (see text)
No credentials cache file found
debug1: An invalid name was supplied
unknown mech-code 0 for mech 1 2 752 43 14 2
debug1: Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 5 14
debug1: Miscellaneous failure (see text)
unknown mech-code 2 for mech 1 3 6 1 4 1 311 2 2 10
debug1: An unsupported mechanism was requested
unknown mech-code 0 for mech 1 3 5 1 5 2 7
debug1: Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 2 5
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
SSH Known Hosts file path is located at /Library/Server/Xcode/Config/ssh_known_hosts
SSH strict host checking is disabled (you can enable this by editing the SSHStrictHostKeyChecking key in /Library/Server/Xcode/Config/xcsbuildd.plist
Untrusted HTTPS certificates is disabled (you can enable this by editing the TrustSelfSignedSSLCertificates key in /Library/Server/Xcode/Config/xcsbuildd.plist
My Question is: Why my authentication is still failing after all configuration setup?
Are there any missing point in set up of GIT or OS X SERVER?
Make sure of the exact account which make the ssh command:
Its $HOME/.ssh must have id_rsa.pub, and id_rsa (public and private key).
Make sure the permission of the .ssh folder and its files is correct, as described in "Git SSH authentication" .
With EGit, those folder are referenced and declared in "Eclipse SSH Configuration":