≡ Menu


Warning: Remote Host Identification Has Changed error and solution

When I run ssh command I get an error which read as follows:

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
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:1
RSA host key for ras.mydomain.com has changed and you have requested strict checking.
Host key verification failed.

How do I get rid of this message?
[click to continue…]

Linux or UNIX securely copy files across a network computer

Q. FTP is insecure, how do I securely copy files across a network computer? My network has Windows and Linux systems.

A. You need to use Openssh client and server technology to copy between two more network computers. You can also find free ssh client tools. scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh.

Copy from Linux to Linux/UNIX system

Copy file called data.txt to ras.nixcraft.in Linux system (vivek is username):
$ scp data.txt vivek@ras.nixcraft.in:/home/vivek

Copy more than two files:
$ scp data.txt pic.jpg vivek@ras.nixcraft.in:/home/vivek
Copy /data directory and all files inside /data i.e. recursively copy entire directories:
$ scp -r /data vivek@ras.nixcraft.in:/home/vivek

Copy from Windows to Linux/UNIX system

You can download any one of the following free Windows SCP client

Just install above client and follow on screen instructions.

Ubuntu Linux OpenSSH Server installation and configuration

Q. I have just installed Ubuntu 6.06 and I would like to allow remote login to my system from home via ssh. How do I install and configure SSH server?

A. OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions.

Ubuntu SSHD Installation

Type the following two command to install both ssh client and server:
# sudo apt-get install openssh-server openssh-client

SSHD Configuration

To be frank your server is ready by default. Just test it from your home computer or from same system with the command:
# ssh localhost
# ssh user@your-server-ip-address

How do I use ssh client?

Assuming that your server hostname is userver.mydomain.com and username is vivek, you need to type the following command:
# ssh vivek@userver.mydomain.com
To stop ssh server, enter:
# sudo /etc/init.d/ssh stop
To start sshs server, enter:
# sudo /etc/init.d/ssh start
To restart ssh server, enter:
# sudo /etc/init.d/ssh restart

See also: