“Cara Install Samba File Sharing Pada Linux Mint 20”
Daftar Isi
Pengantar
Samba adalah implementasi open-source dari Server Message Block (SMB) dan protokol Common Internet File System (CIFS) yang menyediakan layanan file dan cetak antara klien di berbagai sistem operasi. Samba memungkinkan untuk berbagi file antara sistem operasi Linux dan Windows.
Cara Install Samba File Sharing Pada Linux Mint 20
- Install Samba
sudo apt-get -y update sudo apt-get -y install samba
- Konfigurasi Samba
$ sudo mkdir -p /home/share $ sudo chmod 777 /home/share sudo vim /etc/samba/smb.conf [global] # Configure correct UTP unix charset = UTF-8 # Change this to the workgroup/NT-domain name your Samba server will be part of workgroup = WORKGROUP server min protocol = NT1 ntlm auth = yes #interfaces = 127.0.0.0/8 eth0 bind interfaces only = yes # Set share configuration at the end [Docs] path = /home/share writable = yes guest ok = yes guest only = yes create mode = 0777 directory mode = 0777
- Configurasi keamanan Samba
$ sudo chgrp sambashare /home/share $ sudo useradd -M -d /home/share/user1 -s /usr/sbin/nologin -G sambashare user1 $ sudo mkdir /home/share/user1 $ sudo chown user1:sambashare /home/share/user1 $ sudo chmod 2770 /home/share/user1 $ sudo smbpasswd -a user1 $ sudo smbpasswd -e user1
- Buat User lain
$ sudo useradd -M -d /home/share/smbadmin -s /usr/sbin/nologin -G sambashare smbadmin $ sudo mkdir /home/share/smbadmin $ sudo smbpasswd -a smbadmin $ sudo smbpasswd -e smbadmin $ sudo chown smbadmin:sambashare /home/share/smbadmin $ sudo chmod 2770 /home/share/smbadmin
- Konfigurasi Samba
$ sudo vim /etc/samba/smb.conf [user1] path = /home/share/user1 readonly = no Browseable = no force create mode = 0660 force directory mode = 2770 valid user = @user1 @sambashare [smbadmin] path = /home/share/smbadmin readonly = no Browseable = no force create mode = 0660 force directory mode = 2770 valid user = @smbadmin @sambashare
- Restart Service
$ sudo systemctl restart smbd nmbd
$ sudo ufw allow samba
Konfigurasi Samba Client
- Install Samba Client
sudo apt-get install samba-client cifs-utils $ smbclient //sambaserver-ip/share-dir -U sambauser $ smbclient //192.168.100.77/user1 -U user1 $ sudo mkdir -p /mounts/shares $ sudo mount -t cifs -o username=user1 //192.168.100.77/user1 ~/mounts/shares $ sudo vim /etc/fstab //192.168.100.77/user1 /mnt/shares cifs credentials=/.sambacreds 0 0 $ sudo vim /.sambacreds username: user1 password: yourpassword domain: WORKGROUP $ sudo mkdir -p /mnt/shares $ sudo mount -a $ df -hT | grep cifs //192.168.100.77/user1 cifs 20G 14G 6.3G 69% /mnt/shares
Penutup
Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Install Samba File Sharing Pada Linux Mint 20. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.