LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-14-2015, 07:29 PM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Rep: Reputation: 28
Centos 7 public and private keys...


hi people,

i reinstalled my server with centos 7 to get familiar with it...

i have a laptop that im using cygwin on to ssh into the centos 7 server.

i ran ssh-keygen -t rsa on the server and now in .ssh i have a public and private key created.

i copied the public key from the server to my C:\cygwin64\home\Administrator\.ssh\known_hosts file

now when i input:
ssh userontheserver@serversip

it asks for the passphrase which i created when i did the keygen
on the server

when i put the passphrase in it says permission denied
and returns me to the command line

what am i doing wrong?

do i have the steps correct?

am i right in saying that you need to have the servers public key in your known_hosts file on the client computer to get communication working?
 
Old 04-14-2015, 07:38 PM   #2
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
ok so i got it working...had the username wrong...duh!!! was user1 not user

anyway i have a few questions:

1)how come when i regenerated the keys on the server my other laptop using xshell still connected without a problem? i thought it would complain that the key was different...

2)how come when it asked for the password i put in the user password to get it working not the passphrase at key creation...

thanks for the help...
 
Old 04-15-2015, 05:42 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,929

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
If the users password is working then you did not setup public/private keys correctly.

The public key is copyied to hosts authorized_keys file not the known_hosts file. It also must have 600 permissions.
 
  


Reply


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
how does SSH use public/private Keys tripialos Linux - General 5 01-15-2013 03:51 AM
Public and Private Keys??? ajeetraina Linux - Server 2 05-10-2008 03:15 PM
ssh public/private keys lord_darkhelmet Linux - Newbie 8 10-29-2005 04:14 PM
Using GPG without public or private keys darin3200 Linux - Security 3 01-10-2005 04:40 AM
Help with SSH and public/private keys stodge Linux - Security 5 05-14-2003 02:22 PM


All times are GMT -5. The time now is 12:51 AM.

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