Networking Forums

Networking Forums > Computer Networking > Linux Networking > why sshd is running under root ?

Reply
Thread Tools Display Modes

why sshd is running under root ?

 
 
RosalieM
Guest
Posts: n/a

 
      05-14-2004, 05:24 PM
Hi
I dont understand why the deamon for ssh is running under root,
if it crashes it could be secutity problem?
I new that it needs roots to launch listen socket, but why after ?
thanks.


 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      05-14-2004, 05:55 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

RosalieM wrote:

> Hi
> I dont understand why the deamon for ssh is running under root,
> if it crashes it could be secutity problem?
> I new that it needs roots to launch listen socket, but why after ?
> thanks.


I would imagine sshd runs as root in order to properly handle disparate
user logons. sshd is servicing ssh client sessions which may be for any
logon including root. If sshd were prevented from changing
effective/actual userid and effective/actual groupid, then it's spawned
per-logon server processes could not act as the intended logged on user,
but would always act as (have the effective/real uid and gid of) the
sshd daemon user.

Since changing userid and groupid in this manner is an action restricted
to root, then the sshd daemon must retain the root userid.

- --

Lew Pitcher, IT Consultant, Enterprise Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFApQgsagVFX4UWr64RAjtQAJoDPc8PNh678yXRqVbd7I tcpnY8iwCg0eoH
FGVnX3GD7p1cL5JpwzFAlVU=
=uuAm
-----END PGP SIGNATURE-----
 
Reply With Quote
 
Ian Northeast
Guest
Posts: n/a

 
      05-14-2004, 07:49 PM
On Fri, 14 May 2004 19:24:03 +0200, RosalieM wrote:

> Hi
> I dont understand why the deamon for ssh is running under root, if it
> crashes it could be secutity problem? I new that it needs roots to launch
> listen socket, but why after ? thanks.


It has to set the login credentials and fork off a child running as the
user who is logging in. This needs root privilege.

You can reduce the risk by using privilege separation which is often the
default in sshd configurations shipped with Linux, but this can cause
things to break e.g. if you have overriden the default ulimits. SuSE for
instance have recently changed (in SLES anyway) to turning privilege
separation off by default.

If you do use privilege separation you will still see the daemon running
as root but it is actually giving up its root privileges most of the time.

There is very little real risk as long as you keep sshd up to date. Most
distributors publish security patches in a very timely fashion. Sshd is
designed with security as the paramount factor, it comes from the highly
paranoid OpenBSD stable.

Regards, Ian

 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      05-14-2004, 11:46 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

In comp.os.linux.networking Ian Northeast <(E-Mail Removed)> suggested:
> On Fri, 14 May 2004 19:24:03 +0200, RosalieM wrote:


[ sshd running as root ]

> You can reduce the risk by using privilege separation which is often the
> default in sshd configurations shipped with Linux, but this can cause
> things to break e.g. if you have overriden the default ulimits. SuSE for
> instance have recently changed (in SLES anyway) to turning privilege
> separation off by default.


Bad, the last security problems with sshd, perhaps a year ago,
didn't had any impact if privilege separation was turned on.

[..]

> There is very little real risk as long as you keep sshd up to date. Most
> distributors publish security patches in a very timely fashion. Sshd is
> designed with security as the paramount factor, it comes from the highly
> paranoid OpenBSD stable.


Yep, simply run the latest.

$ ssh -V
OpenSSH_3.8.1p1

--
Michael Heiming (GPG-Key ID: 0xEDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFApVo5AkPEju3Se5QRAjHzAJ0Z/onq3qkPREox2j0nr5/CS3j4rACfa0Fv
8EPtqL2r9VE16VLrVfepzgk=
=UbEm
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct way to control alias of a NIC interface from application running as non-root Rohit Linux Networking 5 06-12-2007 09:18 PM
WG311T wireless card is showing c.root-server.net and other root-server.net in netstat. Robert Home Networking 1 05-06-2005 08:13 PM
Postfix config - cron messages for root going to root@ISP. Doug Laidlaw Linux Networking 5 02-27-2005 03:21 PM
Fedora Core 2 NAT Router freezes when left running with Azurus running on a local machine. Lee Caves Linux Networking 0 11-01-2004 08:45 PM
sshd Timeout Buck Turgidson Linux Networking 5 11-08-2003 09:55 PM



1 2 3 4 5 6 7 8 9 10 11