Samba

From Unix Wiki
Jump to: navigation, search

Generic

Packages

To mount samba share you need following packages:

samba samba-client

fstab

fstab record should look like this:

//<REMOTE_SERVER_NAME>/<SHARE> /<MOUTPOINT> cifs _netdev,credentials=<CREDENTIALS_FILE_ABS_PATH> 0 0

CREDENTIAL_FILE

For security reasons it's recommended to set 600 permissions on credentials file.

Credentials file should contain following strings:

username=<USERNAME>
password=<PASSWORD>
domain=<WORKGROUP>

Testing

smbclient

smbclient command may be used for testing:

List of available shares:

smbclient -L //<REMOTE_SERVER_NAME>/<SHARE> -U <USERNAME>%<PASSWORD> -W <WORKGROUP>

Please also note that <WORKGROUP> parameter is very important.