Using SSH keys with different login name - is it possible?
I have COMPUTER A which has a username, let say, John. I have a COMPUTER B which has a username, JohnDoe. I created the public/private keys on COMPUTER A. I send out my public key to COMPUTER B and would like to log in to it with the keys, however, since the login name is different, it does not recognize the keys.
Meanwhile, I have a COMPUTER C with username John that also has the public key of COMPUTER A, and that has no problem since the username is the same. I have tried using the -i option to specify the location of the profile but it does not work and asks me the passphrase for the key, even though there is no passphrase for it: Code:
ssh -i ~/.ssh johndoe@ipaddress |
Maybe the permissions on the remote computer B for .ssh and .ssh/authorized_keys
Use the following commands on Computer B home directory of johndoe chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys Now try loging as usually. This info is from here. http://www.suso.org/docs/shell/ssh.sdf A very good tutorial for ssh. Brian |
I already had it set with those permissions. Any other ideas?
I guess worse comes to worst, I just useradd a john on COMPUTER B, or useradd a johndoe to COMPUTER A |
Much simpler than that! Man ssh would have told you that -l is the login name. So from computer A,
Code:
John@computerA:~$ssh -l JohnDoe computerB Peace, JimBass |
DUHHHH! Sorry guys, it turns out it was user error.
I didn't even create the public/private keys! It's a long story, but for security reasons, I am ssh'ing into 2 computers before I reach my destination of the 3rd computer I am trying to hit, which is then trying to connect to the 4th computer. Because of all those 'hops', I got confused as to which computer I was actually working from. :( :( :( My home <---> Site A <---> Computer A <---> Computer B I need to learn about SSH tunnels, but I'm always confused about it. For example, lets say I do Code:
ssh -L 5900:192.168.1.2:5901 ComputerA |
No I don't think that is correct. This always confuses me.
ssh -L <port to forward local machine>:<local machine you are starting the ssh from>:<port on the remote machine will see the port that was forwared> username@remote machine Brian |
All times are GMT -5. The time now is 03:31 PM. |