Přejít na menu

Samba share

Správa článků

Vyhledávání Vyhledávání
7.5.2014 10:07
,
Počet přečtení: 920
Obrázek ke článku Samba share

How to use and mount Samba on Ubuntu.

+Tutorials on ubuntu.com and ubuntu.cz.

Tips and troubleshootings

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

  1. Create user od Linux:
    adduser niwi
    Optional: add user to some group: usermod -a -G root niwi
  2. Create user in Samba
    smbpasswd -a niwi
  3. 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???).

Vytvořil 7. května 2014 v 10:09:59 mira. Upravováno 6x, naposledy 28. května 2014 v 07:11:51, mira


Diskuze ke článku

Vložení nového komentáře
*
*
*