LinuxQuestions.org
Help answer threads with 0 replies.
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, 02: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, 02:46 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,353

Rep: Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989
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 02:48 PM.
 
Old 01-06-2014, 06: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-07-2014, 12:44 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,353

Rep: Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989
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, 01:46 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
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 04:43 PM.
 
  


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


All times are GMT -5. The time now is 11:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration