Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-24-2013, 07:56 AM   #1
Registered: May 2013
Posts: 189

Rep: Reputation: 1
little confused about the ssh concept

Every one tells on the sites that I should not leave my private key unsecure but I didn't get the explanation anywhere. Why should not I do this?
I want to know how the private key of the server can be harmful if it is in wrong hands.
Suppose someone gets private key of my system then how can he do the damage to my system?


Please explain the functionality of ssh-add and ssh-agent.
What are these commands for?
I am not able to understand the significance of these.
Please explain with the example.

Thanks for your help.
Old 06-24-2013, 08:09 AM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 2,473

Rep: Reputation: Disabled
Originally Posted by unclesamcrazy View Post
I want to know how the private key of the server can be harmful if it is in wrong hands.
Suppose someone gets private key of my system then how can he do the damage to my system?
Someone with access to the private key will be able to decrypt any information encrypted with the public key.

Also, they could successfully impersonate your server, thereby gaining access to account details and/or perform a man-in-the-middle attack.
Old 06-24-2013, 08:58 AM   #3
Registered: May 2013
Posts: 189

Original Poster
Rep: Reputation: 1
Thanks for the reply.
Suppose I have private key of the server. I do not know the password of the server as well as my public key is not saved as authorized_keys on the server. Now how can I log into server using private key.
I have followed this tutorial.
and I tried to log into server using private key but every time it asks password.
# ssh -i /path/of/private/key on/my/system root@192.168.x.xx
where 192.168.xx.xx is IP of the server.
But it asks for password then how private key can be dangerous when I am not able to log in using it.
Old 06-24-2013, 09:15 AM   #4
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Have a look here. The section called "Protecting your private key" is relevant to your question.
Old 06-25-2013, 03:38 AM   #5
Registered: Mar 2013
Posts: 622

Rep: Reputation: 136Reputation: 136
You can use the ssh-add program to add your passphrase one time to the agent and the agent will in turn pass this authentication information automatically every time you need to use your passphrase. So the next time you run:
ssh 192.168.xx.xx
you will be logged in automatically without having to enter a passphrase or password.

Once you've verified that ssh-agent is running, you can add your ssh key to it by running the ssh-add command:
If the program finds the DSA key that you created above, it will prompt you for the passphrase. Once you have done so it should tell you that it has added your identity to the ssh-agent:
Identity added: /home/username/.ssh/id_dsa (/home/username/.ssh/id_dsa)
Now you can try logging into that remote machine again and this time you will notice that it just logs you right in without prompting you for any password or passphrase.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused nay Very Confused chrystlenight SUSE / openSUSE 3 08-28-2007 06:57 PM
rdiff-backup and ssh - I'm a bit confused TheFourthDoctor Linux - Software 4 08-14-2007 03:24 PM
Confused: FTP, SSH, SFTP msymms Linux - Networking 13 06-12-2007 01:35 PM
group sticky bits (confused on how, clear on concept) bpk Linux - Newbie 6 02-03-2005 09:14 PM
frustrated and confused trying to vnc over ssh oldweasel Linux - Software 3 05-27-2004 07:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration