OpenWRT - Add Samba User

Prerequisite:
  1. Assume SAMBA has been installed on your OpenWRT.
  2. Assume you have your external HDD mounted on your OpenWRT

Steps:
  1. Add user at OS level (reference: https://wiki.openwrt.org/doc/howto/secure.access )
    1. Add a new user by editing below 3 files, add new user at last line of each file, with below information (assume UID and GID 1000 is unused!):
      1. /etc/passwd: USER:x:1000:1000:GROUP:/mnt/usb:/bin/false
        /etc/group:  GROUP:x:1000:
        /etc/shadow: USER:xyzDummyString:16666:0:99999:7:::
        
    2. Change password by using passwd command:
      1. passwd USER

        Changing password for
        USERNew password:
        Retype password:
        Password for USER changed by root
    3. Add a Samba user with smbpasswd command:
      smbpasswd -a USER
      New SMB password:
      Retype SMB password:

    4. At LUCI, under "Allowed Users", enter "USER"; uncheck "Allowed Guest" for added security.




Comments

Anonymous said…
You do not need to 'passwd USER' that will create an option to login to linux eg via ssh if configured.

Popular Posts