Tampilkan postingan dengan label Linux. Tampilkan semua postingan
Tampilkan postingan dengan label Linux. Tampilkan semua postingan

Jumat, 28 Oktober 2011

Instalasi OpenVPN Client di Linux

Install aplikasi GUI utuk client

# apt-get install kvpnc
# apt-get install network-manager-openvpn openvpn
Copy setting OpenVPN
# cp -Rf /usr/share/doc/openvpn/examples/easy-rsa/* /etc/openvpn/
Pada Ubuntu Hardy 8.04 tampaknya ada beberapa versi konfigurasi, kita dapat menggunakan salah satu dengan cara
# cp -Rf /etc/openvpn/2.0/* /etc/openvpn/
Selanjutnya lakukan langkah berikut, yang sama dengan versi lainnya
# cd /etc/openvpn
# mkdir /etc/openvpn/keys
Lakukan langkah berikut
# vi vars
# , ./vars
# ./clean-all
Atau copy file /etc/openvpn/vars dari Server. Copy key client dari Server
# scp -r root@192.168.0.3:/etc/openvpn/keys/ca.crt /etc/openvpn/keys
# scp -r root@192.168.0.3:/etc/openvpn/keys/user1.crt /etc/openvpn/keys
# scp -r root@192.168.0.3:/etc/openvpn/keys/user1.key /etc/openvpn/keys

Menjalankan VPN Client (client.conf from www.openvpn.org)
# openvpn --config /etc/openvpn/client.conf

Contoh Client.conf adalah sebagai berikut,
# vi /etc/openvpn/client.conf
isinya kurang lebih
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
; dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
; dev-node MyTap 
# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
;proto tcp
proto udp 
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
;remote my-server-1 1194
;remote my-server-2 1194
remote 192.168.0.3 1194
# Choose a random host from the remote
# list for load-balancing.  Otherwise
# try hosts in the order specified.
;remote-random
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# Most clients don't need to bind to
# a specific local port number.
nobind
# Try to preserve some state across restarts.
persist-key
persist-tun
# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here.  See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings
# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
ca keys/ca.crt
cert keys/client.crt
key keys/client.key
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server".  This is an
# important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server".  The build-key-server
# script in the easy-rsa folder will do this.
;ns-cert-type server
# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
;cipher x
;cipher AES-128-CBC
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
; comp-lzo
# Set log file verbosity.
verb 3
# Silence repeating messages
;mute 20
Cara menjalankan VPN client dengan client.conf (from www.openvpn.org)
# openvpn --config /etc/openvpn/client.conf

Referensi : [1]

Jumat, 17 Juni 2011

Sabtu, 12 Februari 2011

Senin, 07 Februari 2011

Samba

Samba adalah sebuah paket aplikasi yang berfungsi sebagai perantara antara keluarga Windows (9x, NT, dst) dengan keluarga Unix (Linux, FreeBSD, OpenBSD). Tapi pada awalnya pengembangan Samba adalah pada sistem operasi Linux.
Setidaknya terdapat 4 kemampuan dari Samba yaitu :
  1. Berbagi pakai file-file Linux supaya bisa diakses sistem operasi lain atau sebaliknya.
  2. Berbagi pakai file antara sesama Linux.
  3. Menggunakan printer Linux dari sistem operasi lain dan sebaliknya
  4. Membuat Linux menjadi server WINS (Windows Internet Name Service).
Samba dibuat dengan memanfaatkan protokol SMB ( Server Messages Block) yang pada Win family lebih terkenal dengan nama NetBIOS. Pada dasarnya Samba terdiri dari 2 daemon ( program yang menetap di memori) yaitu smbd dan nmbd.
Smbd berfungsi mengatur sumber daya yang dapat digunakan secara bersama baik file maupun printer, menyediakan autentikasi dan otorisasi untuk klien Samba. Jadi daemon ini sebagai “bos” yang mengatur aktifitas antara samba server dengan samba client. Sedangkan nmbd berfungsi sebagai nameserver, yaitu memberikan informasi soal nama komputer yang terdapat pada jaringan dan menyediakan daftar browse.
Untuk mengatur kerja kedua daemon di atas adalah dengan mengedit file smb.conf yang biasanya terdapat pada folder /etc/samba/smb.conf
Pada Linux Ubuntu untuk men-share file /folder pada jaringan, cukup klik kanan pada lokasi folder yang berisi file tersebut, pilih share folder. Jika ingin melihat file yang di share menggunakan samba dapat melalui file browser. Pilih menu Go > Location kemudian ketikkan smb://ip address komputer pada bagian location. Begitu juga jika linux ingin melihat apapun yang dishare oleh windows.
Konfigurasi SAMBA dapat dilakukan melalui terminal pada distro Ubuntu/Debian dengan mengakses :
~$ sudo gedit /etc/samba/smb.conf
Beberapa baris yang harus diedit adalah;
Pada bagian authentikasi, security diisikan menjadi security = share
Pada bagian authentikasi, encrypt passwords = true
Pada bagian authentikasi, guest account = nobody
Pada bagian printing, load printers = yes
Pada bagian printing, printing = cups
Pada bagian printing, printcap name = cups
Pada bagian share definition, tag printers, browseable = yes
Pada bagian share definition, tag printers, public = yes
Pada bagian Misc, baris paling akhir isikan :
usershare allow guests = yes
usershare owner only = false

Pada bagian networking, nilai interface-nya diisi dengan kondisi mesin saat itu
Pada bagian global - browsing identification, berikan nilai baru bernama netbios name dengan nama yang diinginkan. Paling mudah, nama pengguna dari komputer tersebut.
Simpan dan restart service samba dengan menggunakan perintah:
~$ sudo /etc/init.d/samba restart
Silakan dicoba (Ubuntu), klik kanan Folder yang mau dishare > Sharing Option > Share this Folder > Beri Nama Share > Create Share.
Ambil data yang dishare masuk Nautillus Filebrowser, Go > Location > ketik smb://ip address komputer yang dishare.
Berikut langkah-langkah install dan setup samba;
pertama
INSTALL SAMBA. Kalau di mepis udah preinstall sementara di ubuntu daper harus install dulu lewat synaptic.
kedua
BUAT USER. User biasa di linux. Tambahkan sebanyak client yg akan akses ke server ini; [system][admin][add user]
ketiga
BUAT USER UNTUK SAMBA. Caranya pake command line di terminal;
sudo smbpasswd - username
contoh;
sudo smbpasswd -a durahman
(user name dan password harus sama saat create user name dan password di linux).
empat
EDIT FILE smb.conf. File ini adanya di /etc/samba. Edit sesuai kebutuhan. Di ahir dokumen ada contoh configurasi punya gue.
lima
RESTART SAMBA. Perintahnya sbb;
sudo /etc/init.d/samba restart
keenam
Selesai. Kalau configurasinya bener baik windows maupun linux sudah bisa mulai bekerja dgn file server samba yg barusan kita buat.
===begin of file===
[global]
workgroup = DUR_NET
netbios name = DUR_FILES
server string = %h server (Samba %v)
passdb backend = tdbsam
max log size = 1000
server signing = auto
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=4096 SO_RCVBUF=4096
security = user
username map = /etc/samba/smbusers
name resolve order = wins lmhosts bcast hosts
domain logons = yes
domain master = Yes
dns proxy = No
preferred master = yes
wins support = yes
ldap ssl = no
hosts allow = 172.16.0., 172.16.1., 172.16.2., 127.
local master = yes
log file = /var/log/sambalog.txt
logon path = \\%N\%U\profile
# Useradd scripts
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u
idmap uid = 15000-20000
idmap gid = 15000-20000
# sync smb passwords with linux passwords
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
passwd chat debug = yes
unix password sync = yes
case sensitive = no
# set the loglevel
log level = 3
[homes]
comment = Home
valid users = %S
read only = no
browsable = no
[netlogon]
comment = Network Logon Service
path = /home/samba/netlogon
admin users = Administrator
valid users = %U
read only = No
[profile]
comment = User profiles
path = /home/samba/profiles
valid users = %U
create mode = 0600
directory mode = 0700
writable = Yes
browsable = No
[G]
comment = G:
path = /media/data/G/Users
valid users = @users
force group = users
create mask = 0777
directory mask = 0777
read only = No
writeable = Yes
force create mode = 0777
force directory mode = 0777
[x]
comment = X
path = /media/data/G/Users
create mask = 0600
directory mask = 0700
read only = no
writeable = yes
===end of file

referensi: [1][2]

Jumat, 21 Januari 2011