connect to smb share with root access

22,312

Arguments for the valid users parameter must be comma-separated. Also, notice that you typed "writable" instead of writeable. And, because writeable is the inverted synonym of read only, there's no need to declare the read only parameter.

Here's the correct config:

[Daze]
comment = Default connect
path = /
valid users = admin, root 
force user = root
force group = root
browseable = yes
writeable = yes
admin users = root
public = yes
create mask = 0777
directory mask = 0777

Restart your Samba server (run e.g. sudo service smbd restart or sudo systemctl restart smbd.service) with these configs and see if it works.

Share:
22,312

Related videos on Youtube

rahrahruby
Author by

rahrahruby

Updated on September 18, 2022

Comments

  • rahrahruby
    rahrahruby almost 2 years

    Ok, I have smb configured on my Centos 6.7 environment, I have added the user root with smbpasswd -a and when I browse to the share from my windows box I connect with the samba root user I created a password for, but I don't have linux root permissions when I click on the directories. As you can see below, I want to have access to /. Here is the config:

    [Daze]
    comment = Default connect
    path = /
    valid users = admin root 
    force user = root
    force group = root
    browsable = yes
    admin users = root, root
    public = yes
    writable = yes
    create mask = 0777
    read only = No
    directory mode = 0777
    

    Thanks in advance for your help!

    • tomjedrz
      tomjedrz over 3 years
      This is a unwise, which is why there are votes to close the question. Opening Samba write access to the root partition is a significant security risk. It is certainly possible, and if you google samba share root partition should get your answer.
    • NickSoft
      NickSoft over 2 years
      It is not unwise if it's in a properly secured local network.
  • Vicky Penny
    Vicky Penny over 6 years
    I just tried this but it didn't work for my uses Any other ideas? [Daze] comment = Default connect path = / valid users = admin, root force user = root force group = root browsable = yes writeable = yes admin users = root public = yes create mask = 0777 directory mask = 0777
  • Yuri Sucupira
    Yuri Sucupira over 6 years
    @VickyPenny Try setting your shared folder in your smb.conf file with these parameters (replace each ; character with a line break and don't forget to restart the Samba server after saving the changes you did in your smb.conf file): [Shared];path = /;comment = My shared folder;admin users = root;available = yes;browseable = yes;create mask = 0777;directory mask = 0777;force group = root;force user = root;guest ok = no;locking = yes;printable = no;public = yes;root = /;strict locking = no;valid users = root;writeable = yes;write list = root