LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-18-2005, 12:24 PM   #1
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Non-root samba daemons?!


Someone I know is going hire a guy who's selling his services by saying things are unsecure at the moment, because samba is running as root. He promised to secure things by (among a few smaller things) configuring samba to run as a non-root user.

While I know my things around Linux, I know next-to-nothing about Samba. But I don't trust this. Apache can (and should!) run as a non-root user. But samba..?

Is it at all possible, let alone useful, to run samba as a non-priviledged user?
Is this guy a fraud?

Any ideas/opinions welcome. TIA

Last edited by Hko; 08-18-2005 at 12:27 PM.
 
Old 08-18-2005, 02:02 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Samba does a bit of both. Where apache only needs to access files that the "apache" user needs to access, samba needs to access all files that any user on the system may need to access. So the main samba daemon runs as root and then spawns a new proccess as each user as they connect.
 
Old 08-18-2005, 02:22 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Original Poster
Rep: Reputation: 111Reputation: 111
Thanks. But running the processes spawned by the "main-daemon" as the users that connect is done always, and automatically, right?

That's exactly why I think the claim "running samba as non-root" is bogus. Samba needs to run as root, because it needs to fork processes as other users. Only root can do that. (that is correct, right?).

But is it possible for example to run samba as, say, user "data", so all files created on the share (via samba) will be owned by user "data"?

If that's possible, would it still be possible in that case to give different permissions on a share to different samba-users? I suppose not. But is that correct?
 
Old 08-19-2005, 12:49 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
That's the only way I've seen it.

I can't see any reason why you couldn't have a directory owned by "data" run the service as the "data" user but I've never tried it. You wouldn't be able to setuid to other users though.

If you wanted to run it securely they running samba in a chrooted environment is more likely to succede.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
root samba share... batfastad Linux - Newbie 2 04-27-2005 10:36 PM
Samba browsing w/root only Darkest Linux - Newbie 3 03-04-2005 04:36 AM
Samba as root Is OK, but nowhere else Snump Linux - Networking 9 09-18-2004 08:29 PM
Samba Mount - Root Required pkraus109 Linux - Software 0 03-16-2004 12:50 PM
logging into Samba as Root GraemeK Linux - Networking 4 01-02-2004 05:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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