LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-12-2018, 04:52 AM   #1
KatrinAlec
Member
 
Registered: Feb 2012
Posts: 116

Rep: Reputation: 13
ssh login with key


Hello,
I've copied my root key to a server with ssh-copy-id

When I'm already logged into my local system as root, I can access the other server without password.
# ssh x.x.x.x
works fine

But when I'm a normal user and use
$ ssh root@x.x.x.x
I need to login with password.

How come?
 
Old 09-12-2018, 05:09 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
There are two keys by default id_rsa and id_rsa.pub. The public key i.e. id_rsa.pub is copied to the server. If you didn't copy the private key i.e id_rsa to your normal user's ~/.ssh directory or if it does not have the correct permissions you will be unable to login with keys.

While it is possible to share keys you can always create a second pair for your normal user. It is also not recommended to login to root using ssh.
 
1 members found this post helpful.
  


Reply



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
LXer: How to login ssh with private key? LXer Syndicated Linux News 0 05-10-2018 02:15 PM
SSH Login - Bypass public Key check (temp disable passwordless login) Lunar Linux - Networking 1 02-23-2014 04:25 AM
[SOLVED] Cannot login via ssh with key just-to-be Linux - Software 2 07-31-2012 08:19 AM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
Shared Key ssh login only pccdrussell Linux - General 2 10-19-2007 06:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:30 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