1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Root User Samba Access

Discussion in 'Asuswrt-Merlin' started by Empassant18, Jul 12, 2019.

  1. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    I am sorry for posting this, as I have seen some information on this forum and elsewhere about how to do this, but it has to be an easy way to accomplish this. I would like to access my Samba shares with the root login. It just won't work, and I think there is a setting that allows this to happen. It's most important because when the system writes files to my USB disk (such as with Transmission), I am unable to delete the files with a new user I created in the UI that has RW access to the shares. In other words, I can add files and delete them if the secondary user creates them from the Samba share, but if Transmission creates the file, I cannot delete it.

    I imagine a couple of solutions. First, enabling the root Samba user. Second, should I look into changing the permissions on the drive to give the secondary user root access? I could use some help here or link to the article that helps with this issue. Thanks to this community for your support. I try only to post after I have really looked around, and I have run out of time looking over the last couple of days. Thanks.
     
  2. bbunge

    bbunge Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    976
    Location:
    Pennsylvania USA
    Use the admin user and password set for the router. Same as root...

    Sent from my SM-T380 using Tapatalk
     
  3. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,435
    Location:
    UK
    What doesn't work? How are you testing this and what error messages are you getting?
     
  4. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    I am in a macintosh environment. I set up SMBv2 on router with Simpler Share Naming and Master Browser ticked "yes", WINS server, "no." I have two shares set up on my USB drive. The root user is there by default and has RW access. Ideally, I would like to use that user to access the shares on my network, but I also have a secondary user set up that has no problem accessing the shares but does not have root delete privileges from the network (system created files won't delete - Transmission).

    When I try to access with the root user, it does not even allow me a chance to get an error. The login window persists with no ability to log into the server. I read somewhere that Samba deactivates the root user by default. Is that what's going on and how can I change that? The secondary user logs in just fine but no root privileges.
     
  5. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    This doesn't work for me.
     
  6. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,435
    Location:
    UK
    What is the underlying disk format of the USB storage device, FAT32, NTFS, ext2, hfs, etc.?
     
  7. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    ext4
     
  8. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,435
    Location:
    UK
    I suspect the problem is that the shared directory wasn't created through the router's Samba GUI and therefore has the wrong permissions. So to correct that do the following.

    Assuming the device name is VERBATIM and the shared directory name is ASUS, log into the router via SSH and issue the following command:
    Code:
    chmod 777 /tmp/mnt/VERBATIM/ASUS
    I don't know why you can't connect using the root account. It works OK for me, but I'm not a Mac user.
     
  9. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    Thanks for the advice. When I issue that command on the share directory, login again, and try to delete with the secondary user, I get this message, "The operation can’t be completed because you don’t have permission to access some of the items."

    Is anyone else having this problem? Other macintosh users out there?

    Thanks
     
  10. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,435
    Location:
    UK
    You might have the same permissions problem if you are trying to delete items in subdirectories that also weren't created through Samba.

    Take a sledgehammer approach to it with the following command:

    Code:
    chmod -R 777 /tmp/mnt/VERBATIM/ASUS
     
    Empassant18 likes this.
  11. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    That worked!! Thanks for being so responsive! I really appreciate the help.

    For others out there watching, I am still having the root login issue on Macintosh. Any ideas what's going on?
     
  12. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,435
    Location:
    UK
    I don't use Transmission myself but I suspect you will have the same problem reappear when Transmission starts creating new files and directories. A quick search suggests that the "umask" value that Transmission uses by default is 022 (18 in decimal). I suggest that you change that to 000 in Transmission's settings.json file:
    Code:
        "umask": 0, 
     
  13. Empassant18

    Empassant18 Occasional Visitor

    Joined:
    Nov 13, 2018
    Messages:
    26
    This is a good tip! Done and done. Thanks.