LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-04-2005, 02:36 AM   #1
jkmartha
Member
 
Registered: Apr 2005
Location: india
Distribution: Redhat 9
Posts: 66

Rep: Reputation: 15
ssh using public key


fedora core - 2

i want to login to a remote server thru ssh using public key authentication. The remote server is on suse. suppose the username on the remote box is "user1" .
# ssh-keygen -t dsa -b 2048
i created one user with same username "user1" in my box.
i used the above command & placed the private key file in /home/user1/.ssh in my machine & placed the public key file in /home/user1/.ssh in remote machine.

now i try to login using
# ssh user1@x.x.x.x where x.x.x.x is the IP add of the remote box.
the reply is
permission denied : public key
Can anyone guide me ????
 
Old 05-04-2005, 02:52 AM   #2
pevelius
Member
 
Registered: Mar 2004
Location: Tampere, Finland
Distribution: Debian, Familiar, OS X
Posts: 145

Rep: Reputation: 16
(copied from security forum, ssh login attempts thread)

put your private key into the remote system in a file called authorized_keys.

1) Check if you have a .ssh directory
ssh user@remotehost 'ls -l .ssh'

2) If not:
ssh user@remotehost 'mkdir .ssh'

3) Copy your public key
scp $HOME/.ssh/id_rsa.pub user@remotehost:.ssh/authorized_keys

NOTE: if the .ssh directory and the authorized_keys file already exist and the remote system / account are shared or you access user@remotehost from more than one machine then do the following:

scp $HOME/.ssh/id_rsa.pub user@remotehost:.

then

ssh user@remobehost 'cat id_rsa.pub >> .ssh/authoized_keys' to append to rather than overwrite the authorized_keys file.

thatīs what i used. also the authorized_keys-file is configured in sshd config file. adjust your config accordingly.
 
  


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
ssh public key authentication teacup Linux - Networking 4 11-27-2011 11:27 PM
DISCUSSION: Public key authentication with ssh david_ross LinuxAnswers Discussion 31 02-02-2011 08:13 AM
ssh public key authentication problem flgal3 Linux - Software 21 02-06-2009 11:15 AM
SSH - Problem with Public Key Authentication HaPagan Linux - Security 5 11-28-2005 11:27 PM
Newbie: ssh without public key still works? aleet2600 Linux - Security 5 04-15-2004 03:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:36 PM.

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
Open Source Consulting | Domain Registration