Difference between revisions of "SAMBA: Membuat User untuk samba"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 29: | Line 29: | ||
sudo chown :tamu /home/tamu/share | sudo chown :tamu /home/tamu/share | ||
+ | |||
+ | Jika username belum ada, dapat dibuatkan tanpa access ke shell menggunakan perintah | ||
+ | |||
+ | sudo useradd USERNAME --shell /bin/false | ||
Edit | Edit |
Revision as of 12:13, 24 January 2017
Install Samba
sudo apt-get update sudo apt-get install samba
Set password untuk user di Samba
sudo smbpasswd -a <user_name>
Ini akan di simpan di /etc/samba/smbpasswd
Jika <user_name> belum ada, kita perlu menambahkan dengan
sudo adduser <user_name>
Buat folder untuk sharing user tersebut
sudo mkdir /home/<user_name>/<folder_name> sudo chown <user_name> /home/<user_name>/<folder_name> sudo chown :<user_name> /home/<user_name>/<folder_name>
Misalnya
sudo mkdir /home/tamu/share sudo chown tamu /home/tamu/share sudo chown :tamu /home/tamu/share
Jika username belum ada, dapat dibuatkan tanpa access ke shell menggunakan perintah
sudo useradd USERNAME --shell /bin/false
Edit
sudo nano /etc/samba/smb.conf
Isi dengan
security = user
[<folder_name>] path = /home/<user_name>/<folder_name> valid users = <user_name> read only = no
Misalnya
[share] path = /home/tamu/share valid users = tamu read only = no
Restart
sudo service smbd restart
Test parameter
sudo testparm
sudo apt-get install smbclient
# List all shares: smbclient -L //<HOST_IP_OR_NAME>/<folder_name> -U <user>
# connect: smbclient //<HOST_IP_OR_NAME>/<folder_name> -U <user>