Samba with Users
From WL-HDD Wiki
| WL-HDD Contents |
|---|
| What is the WL-HDD |
| Features |
| Pro's/con's |
| Reviews |
| Hacking |
| Inserting the HDD |
| Hacking Guides |
| Basic setup guides |
| Packages guides |
| Requests |
| Troubleshooting |
| This Wiki |
| Credits |
| Editing help |
| Contact Me |
Contents |
[edit] Prerequisites
To complete this guide, the following is assumed:
| You are running Oleg's firmware (1.9.2.7-6b or later) |
| You have harddisk partitions up and running with an extended filesystem mounted to /opt |
| You have installed the Ipkg package system. |
| You have configured your partitions to automount. |
You have setup and successfully run Samba on your LAN (using the guest account) and you have some shares already setup in smb.conf. |
| You have created a new user called 'share' using the Adding Users Guide. |
[edit] Getting Started
First of all, we need to kill any active samba processes.
killall smbd
or
ps -e kill #
where # is the PID of any samba process running (normally processes containing smbd)
[edit] Move files to /etc
It is assumed that the samba configuration file is in /opt/etc/samba , if not, read changing samba location to move your samba files to the new location.
cd /opt/etc/samba
Now lets copy smb.conf to the directory /etc . We are going to create a samba password file and this has to be done in this directory (due to the way that samba was compiled).
cp smb.conf /etc cd /etc nano smb.conf
Change the global settings in smb.conf to the following
[global] workgroup = YOURWORKGROUP guest account = ftp security = user browseable = yes guest ok = yes guest only = no log level = 1 max log size = 100 encrypt passwords = yes smb passwd file=/etc/smbpasswd dns proxy = no
Now save and quit
Ctrl + O Ctrl + X
[edit] Making the smbpasswd file
Now lets add some users
smbpasswd -a share password password
I believe that the passwords in the smbpasswd file have to match those in the /etc/passwd file It is best if you keep them the same. Lets check that the user was added
nano /etc/smbpasswd
You should see the name share, followed by a long string of characters. Exit nano.
Ctrl + O Ctrl + X
Add any other users you wish to add using the same procedure. We don't want to keep smb.conf and smbpasswd in the /etc directory, it is best to run them off the hard disk. Move them back to /opt/etc/samba
mv smb.conf /opt/etc/samba mv smbpasswd /opt/etc/samba cd /opt/etc/samba
Now lets point the smb.conf file to the new location of the smbpasswd file.
nano smb.conf
change the following line
smb passwd file=/etc/smbpasswd
to
smb passwd file=/opt/etc/samba/smbpasswd
We also need to create a samba share for the user share. In this guide, this share will be the users home directory as this has sufficient access rights. Add the following at the bottom of the smb.conf file (already open).
[home] path=/opt/home/share writeable= yes browseable= yes
Save and exit smb.conf
Ctrl + O Ctrl + X
Now lets restart samba to reflect these changes.
/opt/etc/init.d/S97Samba
[edit] Testing Samba
If you are running windows, Click start, Run and type the following:
\\192.168._._ (ip address of your WL-HDD)
Enter your username and password
share password
An explorer box should pop up with a list of the shares available, you can now browse away!
