Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling root access with Samba

Status
Not open for further replies.

Donboy

IS-IT--Management
Aug 20, 2002
73
US
I have samba running great, but I'd like to enable my username to have write permission to root files.

When I login right now, Under users.map I have mapped my PC username to be "root" so that I can read and write to files normally writable only by root. This works great, but I'd like to change it a little. The problem is, when I write new files, the ownership becomes root. Of course I expected this, but that's not really what I'd like. What I'd really like is for my regular username to have write permission to all root files so that the ownership is still root, but I'm able to write to those files.

Any ideas how? I'm not opposed to using Unix group permissions if that is the best way. For example, a while back I tried making my username under Unix a member of the "root" group. I thought that by adding my username to the root group, I would have write permission to any files that were group writeable. Well, that didn't work... or at least I couldn't write to files after changing the permission to group writable. Maybe I was doing something wrong.

I'm not terribly worried about security, because I've told Samba to only respond to the IP address of my machine by using the "hosts allow" directive under [global]. However, if you think there may be other security concerns despite this, please let me know.

Thanks in advance!
 
Can you just add a share to your smb.conf like

[Root]
path = /
comment = Root directory
valid users = your_username
force user = root
writeable = yes

Seems like you can then do pretty much whatever you like. Shame about the compromised security.

><(((°> ><(((°>



 
Hmmm.... I'm having some problems with it. Here's my config file. Please tell me if you see any obvious problems. Also, I think one of my problems would be the user mapping, so I removed the entries where I was mapping my username as root when I added your stuff.

Do you think I needed to reboot windows? I never had to before, but if you think I may have overlooked something obvious, let me know.

[global]
workgroup = MSHOME
log file = /var/log/samba/log.%m
netbios name = Samba
username map = /etc/samba/user.map
hosts allow = 192.168.0. 127.
encrypt passwords = yes
server string = Webserver

[Everything]
writeable = yes
path = /
valid users = donboy
force user = root

 
My smb.conf below.
You can prolly figure out my setup from it.
Yes, only the permitted user can access the root directory. Everyone else can do whatever they like in /samba/...
/home directories disabled too.
No you shouldn't need to rebbot windoZe.

[global]
; basic server settings
workgroup = network
netbios name = Fileserver
server string = Pentium 200 Mhz, RedHat Linux 7.3, Samba %v
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

; PDC settings
local master = yes
domain master = yes
preferred master = yes
os level = 64

; security and logging
dns proxy = no
hide dot files = no
hosts allow = 192.168.0.
Writable = yes
security = user
encrypt passwords = yes
; ssl ca certfile = /usr/share/ssl/certs/ca-bundle.crt
time server = yes
log file = /var/log/samba/%m.log
max log size = 10000

; printing
printing = lprng
load printers = no

# [homes]
# comment = Home Directories
# browseable = no
# writable = yes

[Samba]
comment = Samba %v
path = /samba
read only = no
public = yes
writeable = yes
directory mask = 777
create mask = 777

[Root]
path = /
comment = Root directory
valid users = my-user-name
force user = root
writeable = yes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top