LinuxQuestions.org
Help answer threads with 0 replies.
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 06-05-2008, 10:23 AM   #16
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled

More or less -- the PermitRootLogin without-password directive will disable password authentication for root. The strategy I would follow, then, is to allow Pubkey Authentication and disable all other authentication types in sshd_config. NB: if you leave ChallengeResponseAuthentication enabled, root can still login with his password, so be careful.

I'm not suggesting that you skimp on a layered security approach, BTW. Packet filtering rules, et al, still have their place in this strategy.
 
Old 06-05-2008, 05:26 PM   #17
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Original Poster
Rep: Reputation: 16
Thumbs up

Quote:
Originally Posted by anomie View Post
More or less -- the PermitRootLogin without-password directive will disable password authentication for root. The strategy I would follow, then, is to allow Pubkey Authentication and disable all other authentication types in sshd_config. NB: if you leave ChallengeResponseAuthentication enabled, root can still login with his password, so be careful.

I'm not suggesting that you skimp on a layered security approach, BTW. Packet filtering rules, et al, still have their place in this strategy.
Thanks - for this last bit and for all the earlier discussion/advice too!
 
Old 06-05-2008, 06:03 PM   #18
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
Portknocking may be another useful layer: http://www.portknocking.org/

Having said that, I have to say (call me cranky), that I never get threads like this. I'm racking my brain, but I can't think of a reason that it would be impossible to login as <insert_user_name_here> and then su to get root privileges. You can feel free to ignore this, obviously enough, but I'm genuinely curious: what situation would forbid the creation of a regular user?

Then again, I'm paranoid: I don't even let regular users log directly in via their password.

Last edited by Telemachos; 06-05-2008 at 06:04 PM. Reason: Cleaned up
 
Old 06-05-2008, 06:55 PM   #19
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you log in manually to the servers, then log in as your regular account and use "su" or "sudo". Use public key authentication, and have a strong passphrase. You can use ssh-agent & ssh-add so that you only need to enter in the passphrase once.

Also consider changing the port number that the ssh server uses. This will reduce the number of script kiddie brute force attempts. Then more serious (failed) attempts will probably stand out better in the logs.

If only a handful of people log in to ssh, a good method of control is to use "AllowUsers" which will disallow attempts to login against system accounts or common user names.

Also disable password based authentication so it isn't a fallback. If an allowed user has a week password, this could lead to a cracker getting into the system and start trying to gain root access.

Also, remember the Debian ssl mistake. A public key produced on a Debian or Ubuntu system in that 2 year time period will be in a set of only 32,000 keys. You may want to download this list of bad keys and check this list against the authorized_keys list.

A public key entry in authorized_keys can contain a field with a comma separated host= list of hosts that a user is allowed to connect to using that key. This can help protect against the possibility of a lost key. Also, you could restrict ssh logins to certain networks this way as well.

Last edited by jschiwal; 06-05-2008 at 07:02 PM.
 
Old 06-06-2008, 09:55 PM   #20
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
For me it's a combination of things.

If I really must allow remote root login, then I:

1.- use dsa keypairs and forbid pam authentication, and
2.- change the port to something less evident, and
3.- setup iptables, and
4.- setup fail2ban, and
5.- change root keypairs often, the more often, the higher security

This is really hard to beat. An attacker can't use the root password via ssh if you disable pam, and the ssh key pair can't be guessed either if you change it because fail2ban will allow the attacker only a few attempts before banning it.

Besides this, you can also prepare a honey pot on a chroot and all sort of funny things.

Last edited by i92guboj; 06-06-2008 at 09:56 PM.
 
Old 06-16-2008, 10:13 AM   #21
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Telemachos View Post
Portknocking may be another useful layer: http://www.portknocking.org/

Having said that, I have to say (call me cranky), that I never get threads like this. I'm racking my brain, but I can't think of a reason that it would be impossible to login as <insert_user_name_here> and then su to get root privileges. You can feel free to ignore this, obviously enough, but I'm genuinely curious: what situation would forbid the creation of a regular user?

Then again, I'm paranoid: I don't even let regular users log directly in via their password.
Sorry about the slow reply to this one Telemachos; I just got back from vacation.

The main reason is that I inherited a collection of systems that have a lot of their administrative functions all done automatically via a script that runs from a single machine. User addition, for instance, is done by a script on one machine which adds the user into all of the machines in it's group. (That doesn't mean there isn't a better way to do it though.)

wn
 
  


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
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
Webmin not allowing log in PCON Fedora 0 10-25-2006 12:08 PM
Log in to mysql remotely chamalsl Linux - Security 6 03-23-2005 01:40 PM
vsftpd not allowing users to log in Rokkun Linux - Software 6 11-14-2004 07:46 PM
how do I log out remotely? kleptophobiac Linux - Software 6 01-28-2004 10:16 PM

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

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

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