Results 1 to 10 of 12
Hello,
I need to connect to a linux server using a linux box.
1. The server does not require a password. It is locked down by IP.
2. It requires ...
- 12-08-2010 #1Just Joined!
- Join Date
- Aug 2010
- Posts
- 27
Guidance For SSH
Hello,
I need to connect to a linux server using a linux box.
1. The server does not require a password. It is locked down by IP.
2. It requires a public key/private key.
3. The linux box I was given has .ssh and .gnupg directory with files in them.
What should I do?
This is what I am thinking:
1. Delete everything from .ssh and gnupg directories.
2. Generate new key:3. Give the public key to the server admin.Code:ssh-keygen -t rsa -C "me(at)gmail.com"
4. Then try to connect.
I don't know what command to use when trying to connect. I don't think the normalwould work. What should I type to specify that there is a private key and that I need to connect using port 1901?Code:ssh me(at)X.X.X.X
Any input would be highly appreciated. Many thanks in advance.
- 12-08-2010 #2
When your certificate is in your .ssh folder you can connect with just ssh -p 1901 user@server. The certificate is chosen automatically for you.
Refining Linux Advent calendar: “24 Outstanding ZSH Gems”
- 12-08-2010 #3
You do not need to delete the other stuff in ~/.ssh.
The pulic key needs to be added to ~/.ssh/authorized_keys on the server, for example, once the generated public key file is on the server, you could do
Connect to the server on port 1901Code:cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
Code:ssh -p 1901 user@serveraddress.com
- 12-08-2010 #4Just Joined!
- Join Date
- Aug 2010
- Posts
- 27
Thanks for your fast reply.
Unfortunately, it's not working.
I don't have a ~/id_rsa.pub. Note that this was originally someone else's machine.
I get prompted for a password if I do:
ssh -p 1901 user(at)serveraddress(dot)com
There is no password. I can login fine without any password using putty from windows.
If I don't enter a password I end up with following error:
Permission denied (publickey,gssapi-with-mic,password).
Your kind advice would be very much appreciated.
- 12-08-2010 #5
the .pub file is created when you generate the public/private keys on your client machine.
Code:ssh-keygen -t rsa
- 12-08-2010 #6Just Joined!
- Join Date
- Aug 2010
- Posts
- 27
So, If I skip step one and do the rest I should be okay right?
- 12-09-2010 #7Just Joined!
- Join Date
- Aug 2010
- Posts
- 27
Okay. This is starting to make sense to me.
In my ~/.ssh directory I already have the following files:
Do I still need to make a new key?Code:authorized_keys id_rsa id_rsa.pub known_hosts
- 12-09-2010 #8
Are you files you created with ssh-keygen? If they were already there, I would probably generate a new pair. Depends how paranoid you are that someone else could have the private key.
- 12-09-2010 #9Just Joined!
- Join Date
- Aug 2010
- Posts
- 27
I inherited this computer from someone else. I do not know what he did.
Should I just delete everything and start over?
- 12-09-2010 #10
That's up to you, but there's no harm in removing various config files in your home directory. It just resets things to the default.
I would personally create my own user account on the machine and delete the old one, but again, up to you.


Reply With Quote