Specifications

Buffalo WZR-HP-G300NH - DD-WRT Wiki
http://dd-wrt.com/wiki/index.php/Buffalo_WZR-HP-G300NH#Working_.2F_Not_Working_Features[10/25/2010 1:00:10 PM]
[edit]
[edit]
Anonymous Sharing Setup
This setup will share you disk you already mounted to /mnt folder, It will share for everyone on your network and
don't request username/password to login
To setup, Goto Administrators/Commands section in DD-WRT, copy below script to textbox then choose Save Startup
Setup Sharing with Username/Password
Because smbpasswd program build-in DD-WRT alway treat /etc/samba/smbpasswd as the samba password file, and
/etc is readonly file system, should we must temporary bind /tmp/etc to /etc during add user. Change
# Add user
for samba section like below:
If you need add more user, you can repeat these lines with your username and password
# Stop samba service
killall smbd
killall nmbd
sleep 2
# Configure samba
mkdir -p /tmp/etc/samba
echo "
[global]
netbios name = DD-WRT
workgroup = WORKGROUP
server string = DD-WRT
syslog = 10
obey pam restrictions = yes
socket options = TCP_NODELAY
preferred master = no
os level = 20
security = share
guest account = nobody
invalid users = root, mail, deamon, reboot
null passwords = yes
guest only = yes
map to guest = Bad User
private dir = /tmp/etc/samba/
lock directory = /var/lock/
pid directory = /var/run/
unix charset = UTF-8
dos charset = UTF-8
map archive = No
map hidden = No
map system = No
[Share]
path = /mnt/
read only = no
create mask = 0700
directory mask = 0700
" > /tmp/etc/samba/smb.conf
# Add user for samba
# guest user
grep -q nobody /etc/passwd || echo 'nobody:x:65534:65534:nobody:/mnt:/bin/false' >> /etc/passwd
# Start samba service
SMBOPTIONS="-s /tmp/etc/samba/smb.conf"
/usr/sbin/smbd $SMBOPTIONS
/usr/sbin/nmbd $SMBOPTIONS
# Add user for samba
mount -o bind /tmp/etc /etc
# clear samba user if exists
echo "" > /tmp/etc/samba/smbpasswd
# guest user
grep -q nobody /etc/passwd || echo 'nobody:x:65534:65534:nobody:/mnt:/bin/false' >> /etc/passwd
# add user: username=share, password=sharepassword
grep -q share /etc/passwd || echo 'share:x:65534:65534:nobody:/mnt/:/bin/false' >> /etc/passwd
smbpasswd share sharepassword
umount /etc