Robert,
sure. First of all, disable Samba inside snake's admin page (remember to save the config). Go inside the chroot and install samba:
apt-get install samba
and now configure it (/etc/samba/smb.conf or something like that). I guess you'll need to restart the service every time you change the configuration (/etc/init.d/./samba restart)...
Ah, I'm using my external hdd as /usb/sda1 on Snake and my chroot as /usb/sda1/debian. You may change this whenneeded. :)
To make it start on boot, you can hack the telnet's script file. This is an example:
CHROOTDIR="/usb/sda1/debian"
start() {
# Chroot first...
echo "Preparing chroot..."
mount -o bind /proc /usb/sda1/debian/proc
mount -o bind /dev /usb/sda1/debian/dev
mount -o bind /usb/sda1 $CHROOTDIR/mnt/sda1
# Now run it.
echo "Starting chrooted services..."
chroot $CHROOTDIR /etc/init.d/./samba start
}
stop() {
echo "You can't disable the chroot environment. Reboot the NAS."
exit 1
}
Note: this script might be wrong. This is not exactly the script I'm using to start chrooted services. In my case, I changed telnet's script to start another script (called chroot) and then it mounts everything and executes "/nas/./init" inside the chroot environment, so it can start more serves and it's easier to configure. Anyway, this is just to give you an idea of how to start it.
Remember that after changing any init file on snake (outsite the chroot jail) you need to save the config.
Now you're probably asking "ok, and about smb.conf, what should I do?". Well... the first part of its settings is pretty easy to use. Actually, I remember almost everything from that file that is related to printers (I'm not using printer sharing at all). This is what I did:
Settings:
- Browsing/identification: defaults.. I didn't change anything at all here.
- Networking: also defaults
- Debugging/Accounting: disabled all options (log files may use some CPU and I don't care about logs on a internal network ;)
- Authentication: defaults.
- Misc: I tried to hack the "socket options", but nah... didn't work so great, so I kept the default setting
- Something related to domains: default.
- Everything related to print: just remove it lol
- Shares: remove the defaults (or comment them).
Shares:
[sda1]
# Info
path = /mnt/sda1
comment = sda1
browseable = yes
# Masks
create mask = 0700
directory mask = 0700
# Auth
valid users = debug
guest ok = no
# Hacks
#oplocks = false
#level2 oplocks = false
Ah, also I had to create an user/group. You can use adduser/useradd and addgroup/usergroup to add them. Leave the default home path and bla bla bla. You may remove user's shell if you don't want it to login. Now reset it's samba password (as root):
smbpasswd -a your_username_here
I guess this is it. Everytime you restart samba it takes a few minutes to get online again on Windows, so wait about 3 minutes.
Hope this helps. I'll post this as a page as soon as I have time. Now I need to go to work (it's 7:55 and I'm writing emails :D).
Regards,
Ricardo