We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Fedora 16 not accepting SSH Keys

I'm trying to connect to my Fedora machine using my SSH PEM Key. I've added the key to .ssh/authorized_keys and am still getting promted for a password. The machine can connect to other machine's with the key, but not my Fedora one.

I've setup CentOS to accept SSH Keys but I believe this is my first time for Fedora, maybe there's an extra something I'm missing.

I uncommented these lines in /etc/ssh/sshd_config and still no luck :( :

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys
AuthorizedKeysCommand none
AuthorizedKeysCommandRunAs nobody
2
Contributors
3
Replies
1 Day
Discussion Span
5 Months Ago
Last Updated
4
Views
JySysAdmin
Newbie Poster
18 posts since Nov 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

You need to add the public key part to authorized_keys. The .pem file has the private key. When you ran the program ssh-keygen, it created the .pem file, but it also generated a .pub file. It is the .pub file that you need to append to .ssh/authorized_keys. The following is from the ssh-keygen man page:

 Normally this program generates the key and asks for a file in which to store the private key.  The public key is
 stored in a file with the same name but “.pub” appended.  The program also asks for a passphrase.  The passphrase
 may be empty to indicate no passphrase (host keys must have an empty passphrase), or it may be a string of arbi-
 trary length.  A passphrase is similar to a password, except it can be a phrase with a series of words, punctua-
 tion, numbers, whitespace, or any string of characters you want.  Good passphrases are 10-30 characters long, are
 not simple sentences or otherwise easily guessable (English prose has only 1-2 bits of entropy per character, and
 provides very bad passphrases), and contain a mix of upper and lowercase letters, numbers, and non-alphanumeric
 characters.  The passphrase can be changed later by using the -p option.
rubberman
Posting Maven
2,581 posts since Mar 2010
Reputation Points: 365
Solved Threads: 308
Skill Endorsements: 52

I added the public key part (Did my post lead you to believe that I added the PEM?). I did things the same way as I did on CentOS and it's working there, but not on Fedora for some reason.

JySysAdmin
Newbie Poster
18 posts since Nov 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Ok. Yes, I misunderstood that... :-) Unless the file was mangled for some reason (DOS CR/LF line terminators vs. Unix/Linux LF terminators, for example), then I don't know why Fedora won't work. Anyway, verify that the file is a Linux text file (LF line separators) and not in DOS/Windows format.

rubberman
Posting Maven
2,581 posts since Mar 2010
Reputation Points: 365
Solved Threads: 308
Skill Endorsements: 52

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0609 seconds using 2.65MB