LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 10-03-2003, 10:18 AM   #1
Nyarlathotep
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Rep: Reputation: 0
ssh with password authentication


I seem to have encountered a moronic sysadmin who believes ssh is made more secure by turning off public-key authentication. Sure, people could make passowordless public-keys, but people could also make expect scripts.

Now the security of this guys box is not all that important really in the grand scheme of things, so I'm perfectly happy to have an expect script log myself into it. In fact, I'm using this script already. My problem is that I do not really want to type issh and iscp (standing for idiot ssh and idiot scp). There are three possible solutions:

Worst: Call the expect scripts ssh and scp and make them smart enough so that they do not try to enter a password when this guys system is not involved.

Bad: Hack, ssh to suppose a Password config option next to the User config option on a per hosts basis.

Better: Hack ssh itself to use ssh-askpass for password authentication. Then have ssh-askpass be a script which returns my password on this guys system when needed.. and runs the real ssh-askpass otherwise.

Best: Add a full blown encrypted password authentication mechanism to ssh-agent and ssh. That way ssh-agent would happily pass my password on this guys system off to anyone who wanted it, but the password would not be stored on disk. Instead, I would just type the password into the agent with ssh-add..

Anyone seen any of these systems implemented? I think ssh really needs to support something like this to prevent stupid sysadmins like this guy from shutting down PKI for no good reason. They could keep it off be default, but you really should not need to go to an expect script to get around one of these idiots.

Jeff

BTW> I type this stupid passwords in front of students every day, its more secure to have the password on disk then transfered from my fingers to the keyboard in front of people who might want to try to change their grades.. not that their grades are on that server.. but they do not know that.
 
Old 10-05-2003, 12:49 PM   #2
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
The administrator may not be such an idiot (depending on the reasons he/she has for banning public keys).

I feel the public key/password decision is a balance and I can see why a sysadmin might decide not to allow them.

1. As you say, people can avoid having a passphrase. They can also have trivial passphrases and there is no easy way to prevent this. As you say, people can use expect scripts, but doing this requires knowledge whereas having bad passphrases is something everyone can do.

2. Without a PKI, how do you remove someone's access to a computer? If someone has ever had root access, they could have added a key to any account and the odds are no-one will ever notice. Without public keys it is a bit easier to do this (nothing's perfect of course).

Its always a trade-off. I've always gone with allowing public keys so far, but I can think of some cases where I wouldn't.

Iain.
 
Old 10-05-2003, 04:56 PM   #3
Nyarlathotep
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Passwords suck

Revoking public key access is trivial, just delete the key from the server. If you have suffered serious compramise, you should tell users to revoke all the private keys on the server, especially the passwordless ones. As to people slipping keys onto your server when they hacked it, you should be able to just run a script to make changes to veryone's .ssh/authorized_keys2 file. In fact, grep can easily give you a summery of all keys which can connect from systems which are "off campus." (Your ssh configuration does actually pay attention to what system each key claims to be known from right?) I'd just use an awk script to email everyone a summery of their authorized_keys2 file and ask them to verify it.

No matter what negitive things you have to say about other authentication systems, passwords are inherently easy to "socially enginear." Most people have only a few passwords and an observentt person can easily figure out what the password is based on keystrokes (even from surprisingly far away). Beyond mearly knowing the password, once you know a persons password, you usually know something about how they make up passwords.. never mind that they are very likely to return to their old password eventually.

Anyway, its just a fact that people use better passphrases when they only need to type them rarely. As I said, the best method would be to hand the password off to the agent.

The only time I can imagine passwords ever being better then PKI is for a system which is incredibly infrequently used.. and even then you will use the system in bursts so you should styill be able to add a password to the agent.
 
Old 10-06-2003, 02:17 AM   #4
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
I don't disagree with you; maybe I'm talking about a different situation.

I work in companies where multiple administrators manage each server (necessary when you have hundreds of servers and high uptime requirements). The problem that comes up is, if someone leaves the company or moves departments, how do you remove their access to the server. With passwords its reasonably simple - you delete their account, delete dormant accounts and make sure everyone changes passwords on a regular basis.

With public keys its much more difficult. Sure I can delete user a's public key, but what if user a had root access and has installed a different key in another user account. Am I going to check every account for keys? If I did, would I know what I was looking for? I can assume that the user can get access to a company PC one way or the other, so looking for remote keys is no good either.

Iain
 
Old 10-06-2003, 12:13 PM   #5
Nyarlathotep
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Ah..

Yes, you point that the ex-user could hack a company PC is reasonable. I had kinda been ignoring that. The solutions to this problem are not as painless as I had claimed.

The simplest solution I can imagine is centralizing key managment somewhat. For example, you could have the users home directories NSF mounted accrost all servers (as you would most likely do anyway), but restrict each user to only having one public key in their authorized_keys2 file. The private key for that public key would be kept on their desktopp machine (encrypted) or even on a card. When the user wanted to use the seervers, tehy would load this key into the agent. They would even be able to ssh between servers if tehy turnned on forwarding of the authentication agent (risky in a diffrent way).

Of course, if each machine only has like two users who can login (root and some generic non-root), you can just managed the keys for those two users just as you would manage a password file, but I think you wanted every user to have their own account.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Authentication Application rajsun Programming 2 03-04-2005 12:15 AM
S-l-o-w password recognition/authentication jonr Mandriva 8 11-01-2003 01:49 PM
email password authentication flynnt Linux - Security 1 09-11-2003 02:09 PM
email password authentication flynnt Linux - Networking 0 09-11-2003 01:02 AM
Password Authentication Server Tunarle Linux - Networking 1 07-27-2003 03:55 PM


All times are GMT -5. The time now is 04:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration