Jump to content

Can't use private key for ssh [solved]


T0ken
 Share

Recommended Posts

I just started working at a NOC and we have a private key for ssh that we use on all our servers. All the techs are able to ssh as root to all the servers using this private key.

 

I'm the only tech using Mandriva, and I'm also the only tech who is unable to ssh to a machine without being asked for a password.

 

What I did was:

 

ssh-add [path to key file]

 

When I did that, the message returned was:

 

Identity added: [key file]

 

Now, in theory, I should be able to ssh to any machine without being asked for a password. However, this is what I get when I try to ssh to a machine:

 

The authenticity of host '[x.x.x.x]:port ([x.x.x.x]:port)' can't be established.

RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.

Are you sure you want to continue connecting (yes/no)?

 

What am I missing?

 

Here are the options in my /etc/ssh/ssh_config file:

 

Host *

ForwardX11 yes
Protocol 2,1

# If this option is set to yes then remote X11 clients will have full access
# to the original X11 display. As virtually no X11 client supports the untrusted
# mode correctly we set this to yes.

ForwardX11Trusted yes

# Send locale-related environment variables
#SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
#SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
#SendEnv LC_IDENTIFICATION LC_ALL

GSSAPIAuthentication yes

Edited by T0ken
Link to comment
Share on other sites

Normally, I do it completely different to you. What I do is get that key and add it to the end of .ssh/authorized_keys file in your /home/username directory.

 

For example:

 

cat keyfile >> /home/username/.ssh/authorized_keys

 

and then I can connect to that server in question. Of course, replace keyfile with the name of that file you have with the key inside, and username, with your username on your computer. The >> is important so that you don't overwrite the existing contents of authorized_keys which might have other keys for different servers for you to connect to.

Link to comment
Share on other sites

Thanks for the help!

 

I fixed this today by installing the public key (my trainer either forgot that he need to install it, or Mandriva works with ssh different than Fedora), then adding the private key (after I'd started ssh-agent of course).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...