+Tutorials on ubuntu.com and ubuntu.cz.
Installation
On client
apt-get install samba samba-client cifs-utils
On server
Config file: /etc/samba/smb.conf
[my-share-name]
comment = My shared samba mount
path = /data/my-directory
valid users = niwi
public = no
writable = yes
After change, restart samba server: /etc/init.d/samba restart
Is the samba server daemon running?
ps ax | grep smbd
Users in Samba
Adding the new user
- Create user od Linux:
adduser niwi
Optional: add user to some group: usermod -a -G root niwi - Create user in Samba
smbpasswd -a niwi - Restart Samba server
/etc/init.d/samba restart
Connecting to the Samba server
- Is the samba server daemon running?
ps ax | grep smbd - List all user shares on the server
(run on client): smbclient -L //my-samba-server.com/my-share-name -U niwi
Mounting the share
Mount on client:
sudo mount -t cifs -o user=niwi //my-samba-server.com/my-share-name local-directory-mountpoint -o rw
Unmount:
sudo umount -l local-directory-mountpoint
GVFS
Nautilus uses this tool for mounting Samba (tip source):
gvfs-mount smb://user:pass@server/storage
Note: smbmount is not provided yet on Ubuntu
Shared for multiple users
Use config options force user and force group - all actions for this share will be performed as it is the forced user and group:
[shared]
path = /home/shared
public = yes
only guest = yes
writable = yes
printable = no
browseable = yes
hosts deny = ALL
hosts allow = 192.168.0.
force user = home
force group = home
create mask = 0644
Why I don't use Samba :)
Because of problems with IntelliJ IDEA editor on mounted directories (lot of files in git repository???).