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.
but it looks like that I am doing something wrong so even when I do the copy of the key I keep being asked for a password when I am connecting to the remote server.
I guess the easier would be to help me "start from scratch" as I might be having mixed a bit the files.
If that helps I give a bit of command line history, but as said it would be easier if I start from scratch, rather than trying to fix things
(have to edit a bit the history output to hide some stuff)
Code:
host:/home/user # ssh-copy-id -i id_rsa.pub user@remoteHost
/usr/bin/ssh-copy-id: ERROR: No identities found
host:/home/user # cd /root/.s
.skel/ .ssh/ .subversion/
host:/home/user # cd /root/.ssh/
host:~/.ssh # ls
id_rsa.pub known_hosts known_hosts.old
host:~/.ssh # ssh-copy-id -i id_rsa.pub user@remoteHost
Password:
Now try logging into the machine, with "ssh 'user@remoteHost'", and check in:
~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
host:~/.ssh # ssh user@remoteHost
Password: HERE IS THE PART THAT I STILL NEED TO GIVE PASSWORD
Last login: Wed Mar 27 19:56:33 2013 from remoteHostPartHidden
Have a lot of fun...
user@remoteHost:~> exit
Keys are user specific; you have to copy your current user's key to the remote user's acct, where the local and remote user must be the same.
Do it as that user.
Also check '#AuthorizedKeysFile .ssh/authorized_keys' in /etc/ssh/sshd_config in target server.
###### DIRECTIONS FOR CREATING RSA KEY################
Directions for creating the rsa key and making the two
servers talk to each other without password.
1st change directory into .ssh and check what files are there.
[rx30@rx30 ~]$ cd .ssh
[rx30@rx30 .ssh]$ ls -l
total 4
-rw-r--r-- 1 rx30 group 2980 Jun 13 12:02 known_hosts
2nd create the rsa key.
[rx30@rx30 .ssh]$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/usr/rx30/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /usr/rx30/.ssh/id_rsa.
Your public key has been saved in /usr/rx30/.ssh/id_rsa.pub.
The key fingerprint is:
cb:b0:40:c6:e9:f4:9e:f5:71:fc:c3:00:c0:f7:c6:75 rx30@rx30.localdomain
3rd check that there are two new files with the following permissions
[rx30@rx30 .ssh]$ ls -l
total 12
-rw------- 1 rx30 group 3243 Jun 22 15:50 id_rsa
-rw-r--r-- 1 rx30 group 743 Jun 22 15:50 id_rsa.pub
-rw-r--r-- 1 rx30 group 2980 Jun 13 12:02 known_hosts
4th change directory back to the users $HOME
[rx30@rx30 .ssh]$ cd
5th copy the key to the remote server
[rx30@rx30 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub rx30@XXX.XXX.XXX.XXX
25
rx30@XXX.XXX.XXX.XXX's password:
Now try logging into the machine, with "ssh 'rx30@XXX.XXX.XXX.XXX'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
6th, follow directions on the screen.
[rx30@rx30 ~]$ ssh rx30@XXX.XXX.XXX.XXX
Last login: Fri Jun 22 14:12:08 2012 from 10.10.4.77
[rx30@rx30 ~]$ exit
logout
Connection to XXX.XXX.XXX.XXX closed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.