Home » 2014 » January » 8 » SSH Login Setup

8:38 PM
SSH Login Setup

SSH - OpenSSH SSH client (remote login program)

     ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D port] [-e escape_char] [-F configfile]  [-i identity_file] [-L  [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R  [bind_address:]port:host:hostport] [-S ctl_path] [[email protected]]hostname [command]

     ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network.  X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel.

     ssh connects and logs into the specified hostname (with optional user name).  The user must prove his/her identity to the remote machine using one of several methods depending on the protocol version used.

SSH login without password can help you directly login into a unix session without password.
It also helps you to switch from one unix session to other remote sessions directly
command is : ssh <remote-server>

To get this working, please follow below steps.
1. Generate pub/private keys using RSA algorithms

 ssh-keygen <-t rsa>

 <-t rsa> is optional. If this field not given, ssh-keygen will generate keys using RSA algorithm by default.
This command will prompt to enter directory where the keys will be generated.

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):
 Press Enter to accept default
Enter passphrase (empty for no passphrase):
 Press Enter to accept default
Enter same passphrase again:
 Press Enter to accept default

Your identification has been saved in /home/user1/.ssh/id_rsa.

Your public key has been saved in /home/user1/.ssh/id_rsa.pub.

The key fingerprint is:
some hexadecimal fingerprint user1@server1
The key's randomart image is:


+--[ RSA 2048]----+
| .*o=oo ... |
| . =.. o ..E |
| = o. |
| +.*.. |
| So .o+ |
| . o. |
| o |
| |
| |


now, the keys are generated and saved in the path mentioned as default.

 Accept default responses. 
Just press Enter at every question.
2. Copy the public key to the remote serever where you want to login


 ssh-copy-id -i ~/.ssh/id_rsa.pub

Enter the password of remote server:
This is the first time the password will be asked.

3. ssh 'ssh login without password
Here the session wont prompt for any password.

4. Now you are on remote server.
Next time, when you do ssh , it wont ask for password and you will be redirected to remote server(unix session).

5. To come back to previous server, press ctrl+d.









Category: Open System-Linux | Views: 1568 | Added by: shanky | Tags: private key, ssh-keygen, RSA, public keys, SSH | Rating: 0.0/0

Related blogs

You may also like to see:

[2014-02-23][Open System-Linux]
lwp-download: A command in linux to downlaod large files from internet
[2015-04-23][Open System-Linux]
15 Great DATE command examples
[2014-04-24][Open System-Linux]
Addition of two numbers using shell scripting in UNIX
[2014-04-10][Open System-Linux]
SED command for filtering and transforming texts of a file using regular expression
[2014-06-05][Open System-Linux]
SCRIPT command: Save your Linux sessions automatically

Total comments: 0