LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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
  Search this Thread
Old 06-17-2010, 04:09 AM   #1
tiemen3r
LQ Newbie
 
Registered: Jun 2010
Location: Amsterdam
Distribution: CentOS, Debian
Posts: 15

Rep: Reputation: 1
help setting up secure remote logins


Hi,

I'm trying to secure the CentOS servers on our company network as the current situation is, shall we say, less-than-ideal: remote root logins with the same password across several servers (behind a firewall, on non-standard ports, but still) and several key processes running as root.

My proposal to amend this consists of the following:
- setup a bare as possible SSH-gateway with only the normal user accounts to handle remote access
- disable the root login from anywhere else but LOCAL and create special accounts with root permissions for our ~4 system administrators, like admin.foo admin.bar that can only login from inside the company network, using SSH-keys.

So far my biggest obstacle seems to be creating the administrative users, how do I go about and do that? When I simply create a user adminfoo with uid=0 it will show on my shell as root, which makes it useless as a way to make our admins accountable for their actions.

BTW, my initial proposal to use sudo unfortunately met with strong resistance, because it compromises usability.

I'm also very interested in any opinions about this setup.
 
Old 06-17-2010, 10:21 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,813

Rep: Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747
Quote:
Originally Posted by tiemen3r View Post
Hi,

I'm trying to secure the CentOS servers on our company network as the current situation is, shall we say, less-than-ideal: remote root logins with the same password across several servers (behind a firewall, on non-standard ports, but still) and several key processes running as root.

My proposal to amend this consists of the following:
- setup a bare as possible SSH-gateway with only the normal user accounts to handle remote access
- disable the root login from anywhere else but LOCAL and create special accounts with root permissions for our ~4 system administrators, like admin.foo admin.bar that can only login from inside the company network, using SSH-keys.

So far my biggest obstacle seems to be creating the administrative users, how do I go about and do that? When I simply create a user adminfoo with uid=0 it will show on my shell as root, which makes it useless as a way to make our admins accountable for their actions.

BTW, my initial proposal to use sudo unfortunately met with strong resistance, because it compromises usability.

I'm also very interested in any opinions about this setup.
Sorry, but SUDO is the way to go. Zero-level accounts may just as well be root, so why bother? The single SSH entry point is the best starting point, in this case.

From that box, each user would be able to connect to the other boxes, as their regular, non-root/non-special user. From there, they can SUDO. Reduces usability? BullS__T....all they have to do is type in "sudo <whatever command name>". Take the "sudo -s" option away from them. Why? Because...once they start a "sudo -s" shell, their commands aren't tracked, except through shell history (which can be altered). The "sudo <command>" is logged, and that log can be mirrored to a remote syslog server, so you've got accountability.

If YOU are responsible for these systems, then YOU set the policy. Who cares if the user is a bit inconvenienced? They can do their jobs, and if typing an extra 4 characters is too much for them....they've got problems. Besides, they shouldn't be working as root all the time anyway. I'm guessing that what they REALLY don't want is accountability. Now, they log in as root, do what they want, and can say, "Hey, wasn't me!" if something went wrong. SUDO changes that.

If it's your neck on the line, cover it. Use SUDO, mirror the logs, and make sure you've got a good audit trail for what happens, and who does it. Because right now if something happens...your company will have YOU as the scapegoat, if it's major. Because after all...YOU set up the security, right? And YOU are the one who couldn't tell them who crashed the box....
 
Old 06-17-2010, 10:24 AM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by tiemen3r
BTW, my initial proposal to use sudo unfortunately met with strong resistance, because it compromises usability.
You'll want to stick to your guns on this one. As mentioned, sudo provides the flexibility to fine-tune administrative privileges, and it leaves an audit trail.

Last edited by anomie; 06-17-2010 at 10:26 AM.
 
Old 06-17-2010, 06:11 PM   #4
tiemen3r
LQ Newbie
 
Registered: Jun 2010
Location: Amsterdam
Distribution: CentOS, Debian
Posts: 15

Original Poster
Rep: Reputation: 1
Let me begin to say that, as a user of Ubuntu since its inception, I wholeheartedly agree with you about the advantages of sudo and I greatly appreciate your input. However, since I have a junior position in my company, I'm not in the position to tell people how they should work. Furthermore, my main task is to make our network more secure from attacks from the outside, accountability comes second at the moment.
As TB0ne mentioned, an SSH-gateway will improve the situation greatly in that respect. Every admin has his own workstation here, so we can use originating ip's to identify who's who. SSH-keys will keep our servers secure, even if the gateway is compromised.
That said, sudo could be good solution for our application-administrators. They are not busy editing system files all day, they just need to do things like restarting a process sometimes. If some of these applications weren't running as root, they wouldn't need root access anyway.

System administration in my opinion should be a good balance between usability and security. So I'm curious now, what kind of disaster scenarios could you come up with that could compromise this setup (no remote root, ssh gateway, admin-accounts with ssh-keys for 3-4 persons and sudo for the rest)?
 
Old 06-17-2010, 08:50 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,813

Rep: Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747Reputation: 7747
Quote:
Originally Posted by tiemen3r View Post
Let me begin to say that, as a user of Ubuntu since its inception, I wholeheartedly agree with you about the advantages of sudo and I greatly appreciate your input. However, since I have a junior position in my company, I'm not in the position to tell people how they should work. Furthermore, my main task is to make our network more secure from attacks from the outside, accountability comes second at the moment.
Sorry, I totally disagree. You may have a junior position, but you have to realize that YOU are the one that's accountable. They WILL throw SOMEONE to the wolves if something goes seriously wrong. If you're responsible, you set the policy. If you can't, get your boss, and your boss's boss, to sign off on something (in writing), that says you are in the clear.
Quote:
As TB0ne mentioned, an SSH-gateway will improve the situation greatly in that respect. Every admin has his own workstation here, so we can use originating ip's to identify who's who. SSH-keys will keep our servers secure, even if the gateway is compromised.
That said, sudo could be good solution for our application-administrators. They are not busy editing system files all day, they just need to do things like restarting a process sometimes. If some of these applications weren't running as root, they wouldn't need root access anyway.
Right. Even if they ARE running as root, sudo can still fire them up. Even as a sysadmin, I use sudo. Keeps mistakes from happening, to a point. No one is perfect.
Quote:
System administration in my opinion should be a good balance between usability and security. So I'm curious now, what kind of disaster scenarios could you come up with that could compromise this setup (no remote root, ssh gateway, admin-accounts with ssh-keys for 3-4 persons and sudo for the rest)?
Well, you'd be pretty well covered, but if you leave the workstations open, you're still swinging in the wind. Put good workstation policies in place, to lock the screen, etc. Also, give those workstations static IP addresses, and tie each user account to an IP. So Joe can only log in from 11.22.33.44 or the console, no where else.
 
Old 06-18-2010, 10:52 AM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by tiemen3r
Furthermore, my main task is to make our network more secure from attacks from the outside, accountability comes second at the moment.
Then let's work it from the security angle: what happens if one of your sysadmins' boxes gets pwned? You have no way of enforcing passphrases on their private keys (used for Pubkey Authentication). If one of your lazy sysadmins uses a passphrase-free key, it's game over for you. An industrious cracker has a direct root login to your server.

If instead your sysadmins were set up as sudoers, under the same scenario the cracker would only have a sysadmin login to your server. (That's not a good thing, but it is a much better situation for you, because you will have more time and opportunity to detect a problem while an exploit is prodded for from a regular user account.)

With respect, this should be standard operating procedure where multiple sysadmins are administrating the same host(s).
 
Old 06-18-2010, 06:05 PM   #7
tiemen3r
LQ Newbie
 
Registered: Jun 2010
Location: Amsterdam
Distribution: CentOS, Debian
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by anomie View Post
Then let's work it from the security angle: what happens if one of your sysadmins' boxes gets pwned? You have no way of enforcing passphrases on their private keys (used for Pubkey Authentication). If one of your lazy sysadmins uses a passphrase-free key, it's game over for you. An industrious cracker has a direct root login to your server.

If instead your sysadmins were set up as sudoers, under the same scenario the cracker would only have a sysadmin login to your server. (That's not a good thing, but it is a much better situation for you, because you will have more time and opportunity to detect a problem while an exploit is prodded for from a regular user account.)

With respect, this should be standard operating procedure where multiple sysadmins are administrating the same host(s).

Well, this is something I thought of today: since most of the admins use Windows 7 on their workstations (actually, I'm the only one with a linux workstation), I figured key-management would become a lot easier if I let them SSH as a regular user to the servers and then SSH with their special account to localhost, so both the public and the private key would be stored on the server. As I'm writing this, I realise this sounds like a security hole, but then again, the keyfiles are required to be readable only by the user that owns them.

To summarise: when a workstation is owned, the attacker only has user-access to the servers. I'm pretty confident we can enforce a no-empty-passphrases policy. To own a workstation is not impossible, but hard, because it typically requires user interaction. To gain user access from outside you would first need to gain user access to the SSH gateway and then to a (production) server. Preferably then, the OS on the gateway should be a different one than on the production servers, to prevent crackers from using the same exploit. What remains then is the threat of a lost or stolen password: there this solution is on the same level as sudo.

Last edited by tiemen3r; 06-18-2010 at 07:02 PM.
 
Old 06-20-2010, 05:09 PM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by tiemen3r
I'm also very interested in any opinions about this setup.
Well, you got those opinions from a couple seasoned sysadmins on this thread. It sounds like you generally do not agree. I've nothing more to add.
 
  


Reply

Tags
account, ssh


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
VSFTPD with secure & non-secure logins Ricci Graham Linux - Software 6 02-24-2020 11:49 PM
RHEL4 won't allow remote logins andycyster Linux - Enterprise 4 01-08-2010 11:05 AM
LXer: Four password lockers that can help you keep your Web logins secure LXer Syndicated Linux News 0 10-21-2008 02:50 PM
Allow remote root logins using SSH brendanmcdonald Linux - Software 4 03-05-2006 06:03 PM
need some general help with remote logins felixnine Linux - Networking 5 03-01-2006 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:13 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