[Ubuntu Server] Mengakses Home Directories Ubuntu Server Melalui Windows Menggunakan Samba Server

[Ubuntu Server] Mengakses Home Directories Ubuntu Server Melalui Windows Menggunakan Samba Server

Kita bisa menggunakan aplikasi yang namanya Samba Server untuk mengakses isi dari home directories kita di linux melalui Windows.

Caranya cukup mudah hanya tinggal install Samba Server di Ubuntu Server yang kita miliki, kemudian melakukan beberapa konfigurasi di sisi Samba Server.

Langkahnya adalah:
Harus tau dulu hostname dari ubuntu kita melalui terminal console:

hostname

Yang saya miliki hostnamenya adalah: ubuntu

Menginstall Samba Server:

sudo apt-get install samba smbfs

Mengedit file konfigurasi Samba, saya menggunakan nano:

sudo nano /etc/samba/smb.conf

Ubah isi konfigurasi pada bagian ini:

####### Authentication #######
 
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
;  security = user

Jadi gini:

####### Authentication #######
 
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
security = user
username map = /etc/samba/smbusers

Jangan lupa di-save :D

Buat User Samba Baru(nama user harus sudah ada di ubuntu), misalkan yang mau saya buat nama irfan:

sudo smbpasswd -a irfan

Kita tambahkan user baru tersebut ke file smbusers:

sudo nano /etc/samba/smbusers

Terus isikan seperti ini:

irfan = "irfan"

Berikutnya edit lagi file konfigurasi samba:

sudo nano /etc/samba/smb.conf

Ubah isi konfigurasi menjadi seperti ini:

#======================= Share Definitions =======================
 
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares.  This will share each
# user's home directory as \\server\username
[homes]
   comment = Home Directories
   browseable = yes
 
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = no
 
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700
 
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700
 
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.  Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S

Restart Samba:

sudo /etc/init.d/samba restart

Sekarang windows bisa mengakses home directory ubuntu menggunakan perintah:

\\hostname\username

Misalkan Melalui Address Bar Windows Explorer:

\\ubuntu\irfan
StumbleuponDelicious

IP Address-mu:
38.107.191.81