LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Non-root samba daemons?! (https://www.linuxquestions.org/questions/linux-networking-3/non-root-samba-daemons-354602/)

Hko 08-18-2005 12:24 PM

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

david_ross 08-18-2005 02:02 PM

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.

Hko 08-18-2005 02:22 PM

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?

david_ross 08-19-2005 12:49 PM

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.


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