Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i try to made this way practise, but it still ask me password when i connect via ssh or scp, what should be wrong. 1 machine is rhel 5.5 other is centos 5.5
machine 1
machine 2
private key
public key
generate
1) publickey
2) private key
3) transfer key(private key) to private key
# ssh-keygen (press enter)
# cd /root/.ssh
# cp id_rsa.pub authorised_keys
# ls
# scp authorised_key 192.168.1.105:/root/.ssh/
# ssh 192.168.1.105
One other comment here. I notice that you are putting the key into the ROOT profile. I would highly recommend that you do NOT do this as logging into an SSH connection via root is an extremely BAD practice; you are operating by default in a mode where you could damage something and you have authorized the most abused login ID possible. It is also unnecessary as an authorized user can elevate to root when required.
Instead you should put/append the public key to the /home/a-non-root-user/.ssh/authorized_keys and log in via this user.
Furthermore, I would suggest that you edit your sshd_config and disable root login (set PermitRootLogin no)
Last edited by Noway2; 12-20-2010 at 04:38 AM.
Reason: added sshd modification recommendation
so how can i achive this, as i try 1 key public copy then another is over written etc
you append the contents of the pub key of:
Code:
192.168.1.2's id_rsa.pub = 1 line
192.168.1.3's id_rsa.pub = 1 line
192.168.1.4's id_rsa.pub = 1 line
----> to 192.168.1.1's authorized_key file. Thus it will contain a total of 3 lines now.
note: you don't scp authorized_keys anymore; you manually append the now to that file in 192.168.1.1
Last edited by chickenjoy; 12-20-2010 at 07:28 AM.
it is just for backup purpose single machien carry backup of all machine at the end of the day
I assume you were replying to my comment about allowing root SSH capability. It really doesn't matter what the purpose of the machine is. It is still a bad idea and if you find that this is what is required to make something work it is an indication that something hasn't been setup properly.
If you wish to further restrict access to being from these three machines only, you could also configure the firewall (IPTables) to allow SSH connections from only these three machines.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.