www.centos.org Forum Index CentOS 6 - Networking Support [SOLVED] Unable to connect with SSH and RSA Key
|
Bottom Previous Topic Next Topic |
| |
|
|
|---|
| Poster | Thread |
|---|
|
Re: Unable to connect with SSH and RSA Key | #2 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6361
|
Quote:
Is the 'scp' command broken on your machine? It's much easier than this convoluted workaround and preserves file permissions on the way - which is probably the source of your problems. Try removing the destination file and then running Oh, and it's generally not a good idea to share keys between ordinary users and root - better that each user has their own key that lets them in as themselves and then give sudo access to whatever they need to do and nothing else. Quote:
These are all the default options anyway so this didn't need to be done. If this still doesn't work then you need to check the rest of the permissions on the destination host files and directories. The user's ~/.ssh directory should be chmod 700 and owned by user:user. The authorized_keys file inside it should be chmod 600 and also be owned user:user. You may also want to run the command as the root user to restore the correct selinux contexts to the directory and all its files. |
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/5/1 8:28
|
|||
|
Re: Unable to connect with SSH and RSA Key | #3 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2011/5/10
From
Posts: 5
|
I was not using 'scp' because I has a permission problem (in root !) and I've not solved it, but with your command it works well, maybe the option '-p' resolv it.
I was using root user because I need to backup some directory like /etc or /var and I've thinked that was the best way to do that properly. The goal is to backup somes directory without using a password, automatically with cron. So it's better to give 'sudo' to my user ? It will ask for password if I'm trying to cron an 'rsync' command on directory owned by root ? This is permission of /home/user/.ssh : Permission of the content : Finally, I've executate the command : I've of course restarted sshd somes times. Thanks for your reply. |
||
Posted on: 2012/5/1 9:58
|
|||
|
Re: Unable to connect with SSH and RSA Key | #4 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6361
|
Quote:
Needs to be 700 on /home/user/.ssh not your current 775. Also authorized_keys needs to be 600 not its current 644. |
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/5/1 10:41
|
|||
|
Re: Unable to connect with SSH and RSA Key | #5 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2011/5/10
From
Posts: 5
|
It works well, thanks for your help and your rapidity :).
Cordially, Koshie. |
||
Posted on: 2012/5/1 12:06
|
|||
|
Re: [SOLVED] Unable to connect with SSH and RSA Key | #6 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 9138
|
Thank you for reporting back.
On your behalf (and for posterity) this thread is now marked [SOLVED]. |
||
Posted on: 2012/5/1 23:09
|
|||
Top Previous Topic Next Topic |
|



Topic options
Print Topic
Threaded
Newest First
koshie




You cannot start a new topic.
You can view topic.