Difference between revisions of "SAMBA: Membuat User untuk samba"

From OnnoWiki
Jump to navigation Jump to search
Line 12: Line 12:
 
Ini akan di simpan di /etc/samba/smbpasswd
 
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
 
Buat folder untuk sharing user tersebut
Line 18: Line 22:
 
  sudo chown <user_name> /home/<user_name>/<folder_name>
 
  sudo chown <user_name> /home/<user_name>/<folder_name>
 
  sudo chown :<user_name> /home/<user_name>/<folder_name>
 
  sudo chown :<user_name> /home/<user_name>/<folder_name>
 +
 +
Misalnya
 +
 +
mkdir /home/tamu/share
 +
sudo chown tamu /home/tamu/share
 +
sudo chown :tamu /home/tamu/share
 +
  
 
Edit
 
Edit
Line 26: Line 37:
 
  path = /home/<user_name>/<folder_name>
 
  path = /home/<user_name>/<folder_name>
 
  valid users = <user_name>
 
  valid users = <user_name>
 +
read only = no
 +
 +
 +
Misalnya
 +
 +
[share]
 +
path = /home/tamu/share
 +
valid users = tamu
 
  read only = no
 
  read only = no
  

Revision as of 19:58, 14 February 2016

Sumber: https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way!

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

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

mkdir /home/tamu/share
sudo chown tamu /home/tamu/share
sudo chown :tamu /home/tamu/share


Edit

sudo nano /etc/samba/smb.conf 
[<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

testparm


Akses ke Share di SAMBA

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>


Referensi