LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2007, 12:29 PM   #1
pccdrussell
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 15
Shared Key ssh login only


Hello, I am looking for a way to have the server accept an ssh request only if the client machine has a shared key whether it be RSA, DSA or whatever. So for example... On server1, lets say I have never logged into it before and on my client machine, I type ssh whoever@10.10.10.10 and it comes up with "Authenticy of host x.x.x.x can't be established RSA key finger print is xx:xx:xx...." Is there a way to have it so that it will not even give you that option and you can only log in if you have that Key fingerprint on your client machine. I have done this before for a user on another server by generating a shared key with
Code:
ssh-keygen -t rsa or dsa
then use
Code:
ssh-copy-id -i id_rsa.pub whoever@x.x.x.x
anyway, this is hard for me to explain but hope i have explained well enough and any help would greatly be appreciated!
 
Old 10-19-2007, 04:54 PM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
The trick is that you have to bootstrap that whole mechanism. How do you get it there in the first place if you can't get there? Walk around with a floppy disk and distribute the keys?

The initial step of making that first connection causes the alert to come up so that you can take the extra effort to examine the details and see that you are making the connection that you think you are. It also alerts you if you somehow get directed to somewhere other than you expected.

By your scheme, your second step above would fail, because you had no way to get the key from there to you so that you could make the connection to there and give them your key so that they could then connect to you. Contorted. Yes. Has to start somewhere.
 
Old 10-19-2007, 06:20 PM   #3
pccdrussell
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 62

Original Poster
Rep: Reputation: 15
Reply

I totally understand and agree. However, in a small environment, walking around to each client might not be all that bad. And also, this would be a great scenario if you have a firewall and don't want to completely open up port 22, but if a employee wanted to ssh in remotely, you can give him the key. That way you can have port 22 open with no fear of a user having a weak password.

After posting, i thought of a better way to possibly explain my question. I know how I can share keys for particular users such root for example by creating a key on my local machine and copy it to /root/.ssh/authorized_keys (if I was using root as an example) and configure ssh to not allow PAM passwords.

I guess a better way of asking would be, is there a "global" authorized_keys so that it is not user specific (~/.ssh/authorized_keys) so as an administrator I can ssh in as whoever if need be without having to copy my public key to each user (if I were to use this method). My guess on this is that it is not possible, but a definite answer would be nice to put this issue to rest for me.
Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open-ssh vs. commercial ssh (tru64), public-key auth not possible? cf050 Linux - Networking 8 03-28-2012 11:15 AM
Key repeat on graphical login screen is too fast, Its almost impossible to login. FC5 spacecoyote Fedora 8 05-13-2010 08:53 AM
Shared key authentication and Putty mpmackenna Linux - Newbie 8 10-25-2007 09:06 AM
HELP ME..regd the IWCONFIG for SHARED KEY :-( in LINUX empirixguy Linux - Wireless Networking 1 01-05-2007 09:49 AM
Ndiswrapper Set Shared Key (wep) krayhze Linux - Wireless Networking 0 07-17-2004 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration