Samba
Today I set up samba properly. Previously it only worked one way (viewing windows shares on the linux box) and involved typing the tedious command "sudo mount -t smbfs //192.168.0.1/share /mnt/share" and entering two passwords (one for sudo, and one for the mounting).
Firstly I set up a line in /etc/fstab to make this much quicker.
//192.168.0.1/share /mnt/network smbfs _netdev,noauto,users,password="",fmask=777,umask=777 0 0
Now I can just type "mount /mnt/network" to mount the share. No password is necessary (in actual fact, you could just put a blank password when mounting it manually) since it's in the fstab command (password=""). I also changed sudoers to allow this command to be run without a password, so overall it's much quicker to mount.
The fmask=777 and umask=777 are important as they give regular users permission to write on the shared drive (since windows doesn't have permissions).
The other stage of setting up samba was getting the windows computer to see me, and be able to access my files. This was achieved by setting up a smb.conf file like this:
[global]
workgroup = MSHOME
netbios name = Tux
security = user
password level = 8
deadtime = 3
guest account = nobody
[homes]
browseable = no
writable = yes
[mp3]
path = /home/ian/Music
browseable = yes
guest ok = yes
writable = no
It's quite straightforward since there's not printers or anything complicated to set up. I have two shares set up, for home directories (which require correct username/password to view) and for my mp3s (read only, can be viewed by the guest account, nobody). You have to set up the accounts for any users logging on like this using smbpasswd (just "smbpasswd -a username" as root, there must already be a local account with that name).
Firstly I set up a line in /etc/fstab to make this much quicker.
//192.168.0.1/share /mnt/network smbfs _netdev,noauto,users,password="",fmask=777,umask=777 0 0
Now I can just type "mount /mnt/network" to mount the share. No password is necessary (in actual fact, you could just put a blank password when mounting it manually) since it's in the fstab command (password=""). I also changed sudoers to allow this command to be run without a password, so overall it's much quicker to mount.
The fmask=777 and umask=777 are important as they give regular users permission to write on the shared drive (since windows doesn't have permissions).
The other stage of setting up samba was getting the windows computer to see me, and be able to access my files. This was achieved by setting up a smb.conf file like this:
[global]
workgroup = MSHOME
netbios name = Tux
security = user
password level = 8
deadtime = 3
guest account = nobody
[homes]
browseable = no
writable = yes
[mp3]
path = /home/ian/Music
browseable = yes
guest ok = yes
writable = no
It's quite straightforward since there's not printers or anything complicated to set up. I have two shares set up, for home directories (which require correct username/password to view) and for my mp3s (read only, can be viewed by the guest account, nobody). You have to set up the accounts for any users logging on like this using smbpasswd (just "smbpasswd -a username" as root, there must already be a local account with that name).
