This is the technical scribble pad of Kit Sunde, a freelance software developer doing web things. I'm for hire: kitsunde@gmail.com

Posts Tagged: SSH

Text

Every once in a while I run into an issue where the remote host server identification has changed because of a re-install or other reasons. This comes with an error like:

$ ssh root@127.0.0.1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
2c:af:ca:27:89:36:c0:03:c6:9f:43:74:1e:8e:3a:0d.
Please contact your system administrator.
Add correct host key in /home/kit/.ssh/known_hosts to get rid of this message.
Offending key in /home/kit/.ssh/known_hosts:44
RSA host key for 127.0.0.1 has changed and you have requested strict checking.
Host key verification failed.

In Ubuntu you can fix this by running ssh-keygen with the -R flag, removing the key causing the problem.

$ ssh-keygen -R 127.0.0.1

Text

Usually when I need to copy a database from one spot to the other I log into the server that has the original database and then SSH the data to the server that is supposed to have it:

mysqldump source_database source_table | ssh user@host mysql target_databases

However in this case I couldn’t get the server to connect to another server via SSH, so the command changes slightly. Instead we log into the receiving server and change our command to pull the data to us from the original database.

ssh user@host "mysqldump source_database source_table" | mysql target_database

Text

If you are inputting the SSH password in the keyring password box when connecting to a server and the input box displays:

Enter passphrase for key as [user] on [server]

It means that it’s asking for a ssh-key passphrase rather than the servers ssh password. If you choose to input nothing it instead gives you the option for the servers ssh password that reads:

Enter password for ssh as [user] on [server]