Posts Tagged ‘samba’

[Ubuntu Server] Membuat Simple File Sharing Dengan Samba Server

Seperti biasa install dulu samba

sudo apt-get install samba smbfs

Misalkan kita memiliki:
1. Workgroup namanya: gadjah.net
2. Nama komputer server (Netbios): fileserver
3. Asumsi, sudah memiliki folder yang akan di-sharing, misalkan: /mnt/data
4. Akan di-share dengan nama datashare
5. Hak akses diberikan ke username dengan nama guest
6. Jangan lupa untuk mengubah hak akses untuk folder /mnt/data

sudo chmod 1777 /mnt/data

Kemudian ganti file konfigurasi samba dengan file kosong:

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.ori
sudo nano /etc/samba/smb.conf

Dalam file smb.conf yang baru dibuat, isikan seperti ini:

[global]
   workgroup = gadjah.net
   netbios name = fileserver
[datashare]
   comment = Uji Coba Samba Server
   path = /mnt/data
   read only = no

Restart Ubuntu Server:

sudo /etc/init.d/samba restart

Berikan hak akses samba ke user guest:

sudo smbpasswd -a guest

Kemudian akses melalui Windows Explorer dengan username dan password untuk guest:

\\fileserver\datashare

Tips dan Trik:
Supaya folder yang dishare tidak muncul di My Network Places:

[global]
   workgroup = gadjah.net
   netbios name = fileserver
[datashare]
   comment = Uji Coba Samba Server
   path = /mnt/data
   read only = no
   #Tambahkan Ini:
   browsable = no

Untuk membatasi hak akses user ke folder:

[global]
   workgroup = gadjah.net
   netbios name = fileserver
[datashare]
   comment = Uji Coba Samba Server
   path = /mnt/data
   read only = no
   #Tambahkan Ini:
   valid users = irfan farrell

Dengan konfigurasi di atas maka folder hanya bisa diakses oleh user dengan nama irfan dan farrel saja.

5 comments - What do you think?

Posted by irfan_ardiansah    Date: Thursday, June 4, 2009

Categories: linux, windows

Tags: , ,

[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

2 comments - What do you think?

Posted by irfan_ardiansah    Date: Monday, June 1, 2009

Categories: linux, teknologi, windows

Tags: ,