Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

ssh public and private key

Hi, I update my os x snow leopard to os x lion. I save my ssh private and public key. After my clean instalation of os x lion, I pasted the private and public key on my /.ssh directory. But nothing work (heroku, git, the company server). Does anybody can help me, please?

MacBook Pro, Mac OS X (10.7.2)

Posted on Feb 7, 2012 5:45 AM

Reply
1 reply

Feb 11, 2012 8:46 AM in response to jean-vzla

You would be better served by asking this question in the Mac OS X Technologies forum.


Are you trying to connect from your newly installed Lion system to another server? In which case maybe the permissions on the $HOME/.ssh directory and/or the files within are too weak.


/bin/ls -dleO@ $HOME



drwxr-xr-x+ 119 username group  - 4046 Feb 11 10:10 /Users/username
 0: group:everyone deny delete


/bin/ls -dleO@ .ssh .ssh/*

drwx------   21 username group   714 Jan 26 07:58 .ssh/
-rw-r--r--    1 username group  1879 Oct 13  2006 .ssh/authorized_keys
-rw-------    1 username group   110 Sep 26 17:37 .ssh/config
-rw-------    1 username group   883 Oct 13  2006 .ssh/id_rsa
-rw-r--r--    1 username group   241 Oct 13  2006 .ssh/id_rsa.pub
-rw-r--r--    1 username group 53273 Jan 26 07:58 .ssh/known_hosts


It is possible you use dsa keys, but the permissions should be the same


Many times you can figure out what is happening with ssh by using


ssh -v -v -v username@remote.system.address


which should give you a ton of debugging information. Read it carefully when it mentions trying the ssh keys and see what it says when it rejects them.


If you can go to the destination server and look at where they store their sshd messages that can help. /var/log/secure.log or /var/log/messages or /var/log/system.log. The exact name depends on the destination system, as different flavors of Unix/Linux uses different log files for sshd messages.


If it is the other systems trying to connect with your newly installed Lion system, then it could be that their .ssh/known_hosts file needs to be updated with the new system ssh key (/etc/ssh_host_*_key). Generally you get a long error message when this happens, and in the message it mentions the known_hosts file and the line within the file that needs to be updated. The easiest thing to do is just delete that line from the file on the system where the ssh command is issued. The nuclear option is to delete the entire known_hosts file on the system which is originating the ssh command.


One more thing. If scp and/or sftp are bing used, these commands can fail if the destination system has shell initialization files that echo (print) things to the display while connecting. The scp and sftp commands do not expect to see this stuff, but rather expect to be talking with their counter parts on the remote system. Generally you can see this if you invoke either scp or sftp with the -v -v -v options and you see text in the debugging messages that you would normally see if you logged into that account as an interactive terminal session.

ssh public and private key

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.