Home » 2014 » January » 8 » SSH Login Setup

8:38 PM
SSH Login Setup
 

SSH - OpenSSH SSH client (remote login program)

FORMAT
     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] [user@]hostname [command]


DESCRIPTION
     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: 2058 | 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-03-11][Open System-Linux]
STRINGS : a command in linux to read the non-text files
[2014-02-27][Open System-Linux]
RSYNC : A command in linux to copy files remotely. Faster and more flexible than rcp
[2014-12-22][Open System-Linux]
Key mapping inside VI editor
[2014-12-05][Open System-Linux]
PIDSTAT command for debugging and analysis of Performance of Linux process
[2015-05-25][Open System-Linux]
Password-less Login to Linux/Unix Servers in Putty

Total comments: 0
ComForm">
avatar