Using SSH keys with different login name - is it possible?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
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:
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
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
So how I interpret this is connect to computer A via SSH on port 22, then whatever hits port 5900 on ComputerA will forward to port 5901 on computer 192.168.1.2????
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,697
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.