Jump to content
xisto Community
Sign in to follow this  
abhigyan

Setting Up Ssh For Auto Login

Recommended Posts

<H3 style="MARGIN: 12pt 0in 3pt">Thoughts to consider:</H3>

 

While there are very good reasons why one would need to allow for non-prompted login via SSH, it should be used with care. This process does not give the highest level of security, but does limit the risks of packet sniffers and many hacking tools. Use this process when other options will not work.

 

<H3 style="MARGIN: 12pt 0in 3pt">How to set up SSH for auto login</H3>

 

Consider the following example: user1 on cisbox1 wants to log in as user2 on cisbox2 without supplying a password. To accomplish this, do the following:

 

 

1. Open up a shell window and log in to cisbox1 as user1

 

ie. cidcsccb01.ctg.cummins.com for a cisbox

 

2. From cisbox1, ssh to cisbox2 as user2, using the command "ssh user2@cisbox2". This will test the ssh link between cisbox1 and cisbox2, and will also set up the ssh known_hosts file properly.

 

3. When prompted for the password, enter the password for user2 on cisbox2 to complete the login.

 

4. From cisbox2, ssh to cisbox1 as user1, using the command "ssh user1@cisbox1". This will test the ssh link between cisbox2 and cisbox1, and will also set up the ssh known_hosts file properly.

 

5. When prompted for the password, enter the password for user1 on cisbox1 to complete the login.

 

6. On cisbox1, run the command "ssh-keygen -b 1024 -trsa" at the command prompt. Press ENTER for each prompt. Do not supply anything for the passphrase (just hit ENTER)

 

7. On cisbox1, issue the following command: "cat ~/.ssh/id_rsa.pub >> ~/authorized_keys_from_box1".

 

8. FTP ~/authorized_keys_from_box1 from cisbox1 to cisbox2.If FTP is not possible then copy the file from box1 and paste it in box2 file is saved in .ssh directory. .ssh directory can be found in login directory and file name is id_rsa.pub. For example if you have logged in from /user1 directory then you have to copy the file /user1/.ssh/id_rsa.pub and paste it in box2.

 

9. Check whether sftp is working without password on user1@cisbox1 then check the same for user2@box2. Here if no password is asked and console prompt is changed into sftp> then configuration is complete.

 

10. If there are any other servers that you need to log in to from cisbox1 without a password, repeat the process

 

11. Using command "scp ?r souce_path/source_directory_name user2@cisbox2: destination_path" a directory can be sent from user1@cisbox1 to user2@cisbox2.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.