samba の設定 in Ubuntu 15.04

ii  samba  2:4.1.13+dfsg-4ubuntu3   amd64   SMB/CIFS file, print, and login server for Unix
共有フォルダーの設定

/etc/samba/smb.conf

#======================= Global Settings =======================

[global]

security = user
map to guest = Bad User


#======================= Share Definitions =======================
[samba]
path = /var/tmp/samba
writeable = yes
force create mode = 0666
force directory mode = 0777
guest ok = yes
guest only = yes
#
[uchida]
path = /tmp
writeable = yes
force create mode = 0666
force directory mode = 0777
guest ok = yes
guest only = yes
再起動

# systemctl restart smbd

# systemctl restart nmbd


バージョンの確認
$ smbd -V

$ smbstatus


Arch Linux

# pacman -S samba

# cp /etc/samba/smb.conf.default /etc/samba/smb.conf

# useradd -m smbuser

# passwd smbuser

# pdbedit -a -u smbuser

pdbedit - manage the SAM database (Database of Samba Users)

# systemctl start smbd nmbd

/etc/samba/smb.conf


Client

$ smbclient -L localhost

$ smbclient -L host_server

$ smbclient //host_server/folder_aa

$ smbclient //host_server/folder_aa -U username

$ smbclient //host_server/folder_aa -U username%password


# smbpasswd -a scott
script
#
function samba_add
{
    (echo "$pass"; echo "$pass") | smbpasswd -s -a $user
}

user=scott
pass=tiger
samba_add

Arch Linux

Had to chmod 755 /var/cache/samba/msg, enable and start nmbd


Return

Jul/06/2015 AM 08:15