LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 01-06-2014, 01:22 PM   #1
arcolombo698
Member
 
Registered: Nov 2013
Posts: 31

Rep: Reputation: Disabled
Rsync RSA keys for two different users


Hello.

I am trying to set up an Rsync transfer to a remote server.

I had already created my RSA-pub authorization keys, and am now ready to transfer an rsa key into the remote server.

here is the problem:
The remote server is shared by many users. I cd into the ~.ssh file and found that another rsa-pub key already exists from another user.

what will happen if I transfer my rsa-pub key into the .ssh file when there exists already another?

Thank you very much
 
Old 01-06-2014, 01:46 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You don't put your authorization key file itself into ~/.ssh, you tack the line contained in your key file into the ~/.ssh/authorized_keys file on the destination machine. There can be as many as you want in that file.

The key file you're seeing in ~/.ssh on that machine is for a user who is already logged into that machine and is trying to ssh elsewhere. In other words, that's that machine's outgoing key, the authorized incoming keys are stored in ~/.ssh/authorized_keys or authorized_keys2.

Last edited by suicidaleggroll; 01-06-2014 at 01:48 PM.
 
Old 01-06-2014, 05:10 PM   #3
arcolombo698
Member
 
Registered: Nov 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
rsa_pub

So I was following the directions from
http://wiki.linuxquestions.org/wiki/...reate_ssh_keys

and when I copied over the rsa_pub (under the directions 5th copy)
I overwrote an rsa_pub file that existed there previously.

Is this problematic? How do I fix this issue?

Thank you
 
Old 01-06-2014, 11:44 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Somebody else would have to answer that. I bet you can re-generate the public key from the private key with some openssl command, but I don't know what it is.

In the future, don't follow those instructions. Just open two terminal windows. In one open up your public key in a text editor, in the other you should ssh to the destination machine and open up the ~/.ssh/authorized_keys or authorized_keys2 file in a text editor, then just copy and paste your public key over. You can do it in one command with:
Code:
cat ~/.ssh/id_dsa.pub | ssh -l <user> <remoteserver> "cat - >>.ssh/authorized_keys2"
but I find it faster to just open up two terminals and copy/paste than to type out that monstrosity.
 
Old 01-07-2014, 12:46 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by arcolombo698 View Post
So I was following the directions from
http://wiki.linuxquestions.org/wiki/...reate_ssh_keys

and when I copied over the rsa_pub (under the directions 5th copy)
I overwrote an rsa_pub file that existed there previously.

Is this problematic? How do I fix this issue?

Thank you
you didnt finish reading the link. step 5a talks about copy-id-ssh command and how to deal with it.

do NOT overwrite the rsa_pub on the remote server you are setting up the keys. from the local server do the following:

Code:
$ scp id_rsa.pub remote_server_user@remote_IP:/home/remote_server_user/.ssh/id_rsa.pub.foo
replace foo with what ever you want. then

Code:
$ ssh remote_server_user@remote_IP
--enter password when prompted--
$ cd /home/remote_server_user/.ssh
$ cat id_rsa.pub.foo >> authorized_keys
$ exit
finish with the link you have above.

P.S. I also added these instructions to that wiki link so others can be helped and hopefully avoid the pitfall you have been facing.

Last edited by lleb; 01-07-2014 at 03:43 PM.
 
  


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
Need help understanding rsa keys jasper77 Linux - Security 12 02-11-2011 05:02 PM
Konqueror-RSA Keys XaViaR Linux - General 5 12-03-2006 05:28 AM
SSH Forcing users to use RSA keys XaViaR Linux - Security 8 07-07-2005 12:42 AM
RSA Keys for SSH XaViaR Linux - General 4 07-02-2005 09:15 AM
Where to install RSA keys? KMorley Linux - Newbie 1 02-24-2005 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:01 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
Open Source Consulting | Domain Registration