problem with ssh key - separate users with same uid, group?
I'm working with a guy who has given me an account on his Red Hat server. I.e., I can login via SSH. The weird bit is that my account shares a uid and gid with his account. Is this normal or a really bad idea?
The problem I'm having is that I want to put my public key in ~/.ssh/authorized_keys on the server so that I can login via key pair. I have tried putting it in a variety of places but ssh never attempts to use the key pair for authentication. I had some confusion at first because my user (sneakyimp) and his user (hisuser) apparently each have their own home directory (/home/sneakyimp and /home/hisuser). I've tried putting my public key in both these places but it doesn't work: /home/hisuser/.ssh/authorized_keys /home/sneakyimp/.ssh/authorized_keys I also tried logging in and putting the key in ~/.ssh/authorized_keys and that doesn't work either. when I login using ssh sneakyimp@example.com, the prompt and whoami tell me that I am logged in as hisuser. I've tried to look at the contents of /etc/ssh/sshd_config but I don't have read permission on the file. Can anyone help me figure out where to put my public key? |
Can you please paste the outputs of the following commands?
1. id sneakyimp 2. id hisuser You may try this also: 1. Change directory(cd) to /home/sneakyimp/.ssh 2. you'll find a file name similar to id_rsa.pub ==> If you dont find a file use ssh-keygen command to generate the keys(you may use a passphrase if you want). 3. Now ssh-copy-id -i id_rsa.pub remote-host-name ==> you can use the remote host name if you have DNS working or you may specify the ip address of the remote-host. ==> "ssh-copy-id -i id_rsa.pub remote-host-name" assumes you are having same username in your system and in your remote system ==> If not you should mention your username(username in remote system) at the beginning of the "remote-host-name" as... ssh-copy-id -i id_rsa.pub xxxxxxx@remote-host-name here xxxxxxx= username in remote system. 4. You'll be prompted to enter the password assigned to the remote username(xxxxxxx). 5. When you enter a correct password your public key will be copied to the /home/xxxxx/.ssh/authorized_keys. 6. From now, you can login to the remote host without a password. ****Note: Mark this post as helpful,if it helps you. |
Here is the output of the commands:
Code:
[hisuser@hostname ~]$ id sneakyimp the .ssh stuff just plain does not work -- there are no .ssh directories in either home directory. As I mentioned in my original post, I have tried putting my public key in a variety of locations. I have done this many times on other hosts and it works just fine. |
Quote:
If so... You can create the .ssh directory & authorized_keys file in it manually. Can you try this? |
Did you execute the ssh-keygen command?
|
Quote:
|
I'm sorry..if my posts made you angry.
Can you please post the output when you execute: Quote:
|
this is the output:
Code:
sneakyimp@my-workstation:~/$ ssh-copy-id sneakyimp@dev.example.com Code:
sneakyimp@my-workstation:~/$ ssh sneakyimp@dev.example.com When I us my password to login after running that command, I see that the command has copied not just the public key that I want to copy but others as well to ~/.ssh/authorized_keys (which is the same as /home/sneakyimp/.ssh/authorized_keys). |
I created a user with name "remote" on my system & changed the uid & gid to the local user uid & gid.
as you can see it from the below: Quote:
Quote:
Quote:
After that..ssh-copy-id worked fine.. & i'm able to login without a password prompt. I can post you the /etc/ssh/ssh_config file content if you want,though i didn't even touched it. local system os: Fedora16 remote systemos : Fedora17. |
All times are GMT -5. The time now is 08:23 PM. |