Tag-Archive for » ssh connetion «

Monday, November 10th, 2008 | Author: Angelo

SSH without authentication while opening multiple sessions.

While working on a remote server via SSH, we need to open multiple sessions for the same remote server. Suppose, you are logged into a server 10.10.10.1, and now you want to transfer a file to server X from your local machine. Then you will have to copy those files using scp, for which you need to enter password while establishing a fresh connection to server X. So, it takes some time as well as it is irritating to enter password again and again.

Here’s the remedy :

Open the file /etc/ssh/ssh_config on your local machine as root to edit. Or if you are not the root user, you can create a file ~/.ssh/config for user level SSH configurations.

Add the following lines at the end of the file you opened just now:

ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p

Save the file and you are done !!

Now check out (One can try it this way) - Open a terminal and connect to a server :

$ ssh root@10.10.10.1

The connection gets established after entering the proper password.

Then in another terminal try to copy a file from your local machine to the same server :

$ scp -r ~/pintos root@10.10.10.1

This time, you don’t need to wait for a fresh connection, neither you will have to enter the password again. File transfer starts instantaneously. SSH shared the already established connection. Similarly you can open another terminal without waiting and entering the password again.