Selasa, 19 Januari 2010

Teks untuk Linux

Perintah Teks Linux
Diposkan oleh seta basri at 13 Februari 2009

whoami

whoami adalah perintah teks untuk mengetahui user aktif saat ini.
Cara menggunakannya, ketik :
$ whoami [lalu tekan enter]
idrismuktawa-tkj2
$
Jadi, user aktif saat ini adalah idrismuktawa-tkj2
pwd

pwd adalah perintah teks untuk mengetahui direktori aktif saat ini. Atau, mengetahui kita saat ini ada di direktori apa.

Cara menggunakannya, ketik :

$ pwd

/home/idrismuktawa-tkj2

$

Jadi, saat ini kita tengah berada di direktori level 2 yaitu /home/idrismuktawa-tkj2
cd

cd adalah perintah teks untuk berpindah direktori.

Misalnya, saat ini kita tengah ada di direktori /home/idrismuktawa-tkj2. Lalu, kita hendak pindah ke direktori /opt. Maka kita mengetik sebagai berikut :

$ cd /opt [tekan enter]

$

Jadi kita kini berada di direktori /opt.

Tugas cd :

Pindahlah ke direktori-direktori berikut :

/bin

/dev

/opt

/home/userkamu

/media

/mnt
mkdir

mkdir adalah perintah teks untuk membuat direktori baru.

Penting diingat, ketahui dahulu kini kita ada di direktori apa ? Jika sudah tahu kini kita ada di direktori mana, maka baru boleh kita membuat direktori baru dengan perintah mkdir ini.

Misalnya, kita hendak membuat direktori baru bernama :

/opt/file-idrismuktawa

Direktori baru yang hendak dibuat adalah file-idrismuktawa. Lokasi pembuatannya di direktori /opt. Direktori /opt ini level 1 dan sudah ada, bukan? Nah, untuk membuat direktori baru idrismuktawa itu, ketikkan perintah berikut:

$ cd /opt [tekan enter, kita pindah ke direktori /opt]

$ mkdir file-idrismuktawa [tekan enter]

$

Direktori baru bernama /opt/file-idrismuktawa telah terbuat.

Tugas mkdir :

Buatlah direktori-direktori baru berikut :

/home/userkamu/one

/home/userkamu/two

/opt/balon

/opt/kuda

/home/userkamu/one/satu

/opt/balon/merah

/home/userkamu/two/duwa

/opt/kuda/hitam
ls -l

ls -l adalah perintah teks untuk melihat isi sebuah direktori.

Cara penggunaan :

Misalnya kita hendak melihat isi dari direktori /home/idrismuktawa-tkj2. Untuk itu, kita harus pindah dulu ke direktori /home/idrismuktawa-tkj2. Setelah itu, baru kita ketikkan perintah ls -l. Urutan langkahnya sebagai berikut :

$ cd /home/idrismuktawa-tkj2 [tekan enter, kita pindah direktori]

$ ls -l [tekan enter]

$

Isi direktori /home/idrismuktawa-tkj2 sudah terlampirkan. Silakan diperhatikan, deh.

Tugas ls -l :

Lihatlah isi direktori-direktori berikut :

/home/userkamu/one

/home/userkamu/two

/opt/balon

/opt/kuda

/home/userkamu/one/satu

/opt/balon/merah

/home/userkamu/two/duwa

/opt/kuda/hitam
su

su adalah perintah teks untuk berpindah user.

Misalnya, Idris dan Nikolus menggunakan 1 komputer tapi berbarengan. Keduanya sudah punya user masing-masing. Idris nama usernya idrismuktawa-tkj2 sementara Nikolus punya user namanya nikolus-tkj1. User yang aktif saat ini adalah punya Idris. Tapi, Nikolus mau pakai, mau lihat data pribadi katanya. Sebab itu, yang harus Nikolus lakukan adalah mengetik perintah berikut :

$ su nikolus-tkj1 [enter]

$ passwd : [ketikkan password user nikolus-tkj1, lalu enter]

$

Dengan demikian user aktif sudah berpindah dari idrismuktawa-tkj2 menjadi nikolus-tkj1. Kalau kamu penasaran, ketikkan saja perintah whoami. Coba.
vi

vi adalah editor teks linux, yang fungsinya mengetik program baru ataupun sekadar membuat file.

Cara penggunaan :

Untuk membuat file baru dengan vi, kamu harus sadar di direktori mana kini kamu berada. Misalnya, kita hendak membuat file baru bernama :

/opt/file-idrismuktawa/idris-oke.txt

File baru tersebut terdapat di dalam direktori level 2 yaitu

/opt/file-idrismuktawa

Untuk membuat file idris-oke.txt maka ketikkan perintah berikut :

$ cd /opt/file-idrismuktawa [kita pindah ke direktori /opt/file-idrismuktawa]

$ vi idris-oke.txt [tekan enter]

muncul layar kerja vi

ketikkan isi file, misalnya :

Nama aku Idris Muktawa. Aku senang deh masuk TKJ.

untuk menyimpan, tekan tombol-tombol berikut secara berurutan :

: w q

Otomatis file baru bernama idris-oke.txt sudah terbuat. Jika kamu penasaran, ketikkan saja perintah ls -l untuk melihat isi direktori /opt/file-idrismuktawa

Tugas :

Buatlah file-file baru berikut :

/home/userkamu/one/one.txt [isinya bebas, satu kalimat saja]

/home/userkamu/two/two.txt [isinya bebas, satu kalimat saja]

/opt/balon/balon.txt [isinya bebas, satu kalimat saja]

/opt/kuda/kuda.txt [isinya bebas, satu kalimat saja]

/home/userkamu/one/satu/satu.txt [isinya bebas, satu kalimat saja]

/opt/balon/merah/merah.txt [isinya bebas, satu kalimat saja]

/home/userkamu/two/duwa/duwa.txt [isinya bebas, satu kalimat saja]

/opt/kuda/hitam/hitam.txt [isinya bebas, satu kalimat saja]
cp

cp adalah perintah teks untuk mengkopi suatu file atau direktori.

Cara penggunaan :

Idris hendak mengkopi file /opt/balon/balon.txt ke direktori /home/idrismuktawa-tkj2. Yang harus dilakukan Idris : Pertama, Idris harus pindah dulu ke direktori /opt/balon sebagai lokasi file balon.txt. Kedua, Idris baru mengetikkan perintah cp. Lihat di bawah ini :

$ cd /opt/balon [tekan enter, pindah direktori]

$ cp balon.txt /home/idrismuktawa-tkj2 [enter]

$

Secara otomatis, file /opt/balon/balon.txt sudah terkopi ke /home/idrismuktawa-tkj2. Jika penasaran, maka lihat saja dengan perintah ls -l

Tugas cp :

Kopilah file-file berikut ke direktori /home/userkamu

/opt/balon/balon.txt

/opt/kuda/kuda.txt

/opt/balon/merah/merah.txt

/opt/kuda/hitam/hitam.txt
ps -ax

ps -ax adalah perintah teks untuk melihat daftar program apa saja yang sedang berjalan saat ini.

Cara penggunaan :

Jalankan Mozilla Firefox. Setelah Mozilla Firefox tampil, buka Terminal. Lalu ketikkan hal-hal sebagai berikut :

$ ps -ax [tekan enter]

$

Secara otomatis, akan keluar daftar program apa saja yang tengah berjalan saat ini. Perhatikan kode program.
kill -9

kill -9 adalah perintah teks untuk mematikan secara paksa suatu program yang tengah berjalan. Ini dilakukan tatkala komputer Linux kita mengalami crash atau hang.

Cara penggunaan:

Jalankan Mozilla Firefox. Setelah Mozilla Firefox terbuka, lalu hendak kita matikan dengan perintah kill -9. Perintah yang harus kamu ketik sebagai berikut :

$ ps -ax [tekan enter, lihat kode Mozilla Firefox]

$ kill -9 4421 [kode Mozilla Firefox misalnya 4421, tekan enter]

$

Secara otomatis, Mozilla Firefox akan mati tanpa kita harus klik File > Exit atau File > Close. Mudah, bukan ?

Tugas kill -9 :

Bukalah program-program berikut, lalu tutup dengan menggunakan perintah kill -9:

* The Gimp
* Calculator
* Office Writer
* XPdf

ping

ping adalah perintah untuk melakukan tes koneksi PC Linux kita dengan PC atau suatu address.

Cara penggunaan:

Misalnya, kita hendak melakukan tes koneksi dengan Komputer Server Sandikta. Address Gateway-nya 192.168.10.253. Maka lakukan perintah berikut :

$ ping 192.168.10.253 [tekan enter]

$

Secara otomatis, akan terbetik kabar sehubungan dengan keadaan koneksi kita, apakah Destination Host Unreachable atau Reply from .... Coba lihat deh.

Tugas ping:

Lakukan pengetesan koneksi PC kalian dengan alamat-alamat berikut :

www.yahoo.com [caranya, ketik ping www.yahoo.com]

www.google.com

router menggunakan freeBSD

Membangun PC Router Menggunakan FreeBSD
23 Februari 2009 northskh Tinggalkan komentar Go to comments

Membangun PC Router Menggunakan FreeBSD

Untuk membuat PC Router dengan freebsd, terlebih dahulu kumpulkan informasi
mengenai skema alamat logikal dari jaringan yang ada. Sebagai contoh kita
asumsikan jaringan yang ada memiliki:

IP Public = 210.100.12.130
IP LAN = 192.168.12.65
Alamat jaringan LAN = 192.168.12.64/26
Router yang dibuat akan dilengkapi dengan firewall menggunakan pf pada FreeBSD.
Jika anda menginginkan menggunakan iptables seperti pada Linux, anda dapat
menggunakannya dengan menginstalasi iptables dari source.

Langkah-langkah pembuatan:

1. Siapkan komputer beserta 2 kartu jaringan yang telah terinstal sistem operasi
FreeBSD.
2. Selanjutnya, karena dalam default kernel FreeBSD yang baru terinstal tidak
terdapat opsi tambahan untuk router maka kita harus mengkompilasi
ulang kernel. Tujuannya selain untuk memasukkan opsi-opsi yang dibutuhkan juga
untuk merampingkan kernel sehingga dapat mempercepat waktu loading, menghemat
memori. Langkah-langkah kompilasinya:

a. Salin file GENERIC kernel pada sebuah file dengan nama baru (misal:ROUTER)
dan edit file tersebut menggunakan teks editor.

# cd /usr/src/sys/i386/conf
# cp GENERIC ROUTER
# ee ROUTER

b. Dalam mengedit file ROUTER, ganti baris “ident” dengan nama kernel yang
baru (sesuaikan dengan nama file tentunya). Hilangkan opsi-opsi yang tidak
diperlukan, namun hati-hati bila anda belum begitu tahu dengan apa yang
opsi anda hilangkan. Kemudian tambahkan opsi :

#-mulai#

options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_PRIQ
options ALTQ_HFSC
options ALTQ_NOPCC

device pf
device pflog
device pfsync

#selesai-#

Kemudian simpan konfigurasi tersebut.

c. Lakukan kompilasi kernel baru. Perintahnya:

# config ROUTER

Akan ditunjukkan direktori untuk memproses kompilasi. Apabila terdapat
kesalahan sintaks, anda dapat memperbaiki padafile ROUTER.

# cd ../compile/ROUTER
# make depend && make && make install

Apabila terjadi kegagalan kompilasi, sebelum memeriksa file ROUTER anda
diharuskan memberikan perintah

# make cleandepend

Jika kompilasi berhasil, anda dapat menggunakan kernel yang baru setelah komputer di-reboot, setelah konfigurasi selesai.

3. Atur IP forwarding

# ee /etc/sysctl.conf

tambahkan baris:

net.inet.ip.forwarding=1

simpan konfigurasi tersebut.

4. Untuk konfigurasi opsi jaringan, NAT serta pf pada sistem, edit file /etc/rc.conf .

# ee /etc/rc.conf

atur atau tambahkan baris:

#-mulai#

router_enable="YES"pf_enable="YES" # Enable PF (load module if required)pf_rules="/etc/pf.conf" # rules definition file for pfpf_flags="-q" # additional flags for pfctl startup

#selesai-#

5. Pengaturan NAT serta pf, ada pada file /etc/pf.conf .

# ee /etc/pf.conf

aktifkan interface serta NAT:

ext_if=”rl0″ # jaringan publik
int_if=”rl1″ # jaringan lokal
internal_net=”192.168.12.64/26″
external_addr=”210.100.12.130″
nat on $ext_if from $internal_net to any -> $external_addr
pass on $int_if from any to any

setelah selesai simpan konfigurasi.
Ketikkan perintah:

# /etc/netstart

Konfigurasi untuk PC Router FreeBSD telah selesai, agar komputer dapat mengenali
konfigurasi yang baru, reboot terlebih dahulu. Kemudian untuk mengetes koneksi dapat
anda coba pada router dan/atau klien dengan perintah ping. Selanjutnya dapat
anda tambahkan DHCP server yang umum terdapat pada router.

freeBSD

FreeBSD
Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
FreeBSD adalah sebuah sistem operasi bertipe Unix bebas yang diturunkan dari UNIX AT&T lewat cabang Berkeley Software Distribution (BSD) yaitu sistem operasi 386BSD dan 4.4BSD. FreeBSD berjalan di atas sistem Intel x86 (IA-32) (termasuk Microsoft Xbox[1], DEC Alpha, Sun UltraSPARC, IA-64, AMD64, PowerPC dan arsitektur NEC PC-98. Dukungan untuk arsitektur ARM dan MIPS sedang dalam pengembangan.
From Wikipedia, the free encyclopedia
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via the Berkeley Software Distribution (BSD). It has been characterized as "the unknown giant among free operating systems".[1] It is not a clone of UNIX, but works like UNIX, with UNIX-compliant internals and system APIs.[2] FreeBSD is generally regarded as reliable and robust.[3]FreeBSD is a complete operating system. The kernel, device drivers and all of the userland utilities, such as the shell, are held in the same source code revision tracking tree, whereas with Linux distributions, the kernel, userland utilities and applications are developed separately, then packaged together in various ways by others.[4]Third-party application software may be installed using various software installation systems, the two most common being source installation and package installation, both of which use the FreeBSD Ports system.
History
FreeBSD's development began in 1993 with a quickly growing, unofficial patchkit maintained by users of the 386BSD operating system. This patchkit forked from 386BSD and grew into an operating system taken from U.C. Berkeley's 4.3BSD-Lite (Net/2) tape with many 386BSD components and code from the Free Software Foundation. After two public beta releases via FTP (1.0-GAMMA on September 2, 1993, and 1.0-EPSILON on October 3, 1993), the first official release was FreeBSD 1.0, available via FTP on November 1st, 1993 and on CDROM on December 30, 1993. This official release was coordinated by Jordan Hubbard, Nate Williams and Rodney W. Grimes with a name thought up by David Greenman. Walnut Creek CDROM agreed to distribute FreeBSD on CD and gave the project a machine to work on along with a fast Internet connection, which Hubbard later said helped stir FreeBSD's rapid growth. A "highly successful" FreeBSD 1.1 release followed in May 1994.[5]However, there were legal concerns about the BSD Net/2 release source code used in 386BSD. After a lawsuit between UNIX copyright owner at the time Unix System Laboratories and the University of California, Berkeley, the FreeBSD project re-engineered most of the system using the 4.4BSD-Lite release from Berkeley, which, owing to this lawsuit, had none of the AT&T source code earlier BSD versions had depended upon, making it an unbootable operating system. Following much work, the outcome was released as FreeBSD 2.0 in January 1995.[5]FreeBSD 2.0 featured a revamp of the original Carnegie Mellon University Mach virtual memory system, which was optimized for performance under high loads. This release also introduced the FreeBSD Ports system, which made downloading, building and installing third party software very easy. By 1996 FreeBSD had become popular among commercial and ISP users, powering extremely successful sites like Walnut Creek CD-ROM (a huge repository of software that broke several throughput records on the Internet), Yahoo! and Hotmail. The last release along the 2-STABLE branch was 2.2.8 in November 1998.[6] FreeBSD 3.0 brought many more changes, including the switch to the ELF binary format. Support for SMP systems and the 64 bit Alpha platform were also added. The 3-STABLE branch ended with 3.5.1 in June 2000.[5]
Security
FreeBSD provides several security-related features including access control lists (ACLs), security event auditing, extended file system attributes, fine-grained capabilities and mandatory access controls (MAC). These security enhancements were developed by the TrustedBSD project. The project was founded by Robert Watson with the goal of implementing concepts from the Common Criteria for Information Technology Security Evaluation and the Orange Book. This project is ongoing and many of its extensions have been integrated into FreeBSD.The project has also ported the NSA's FLASK/TE implementation from SELinux to FreeBSD. Other work includes the development of OpenBSM, an open source implementation of Sun's Basic Security Module (BSM) API and audit log file format, which supports an extensive security audit system. This was shipped as part of FreeBSD 6.2. Other infrastructure work in FreeBSD performed as part of the TrustedBSD Project has included SYN cookies, GEOM and OpenPAM.While most components of the TrustedBSD project are eventually folded into the main sources for FreeBSD, many features, once fully matured, find their way into other operating systems. For example, OpenPAM and UFS2 have been adopted by NetBSD. Moreover, the TrustedBSD MAC Framework has been adopted by Apple for Mac OS X.Much of this work was sponsored by DARPA.
FreeBSD has a repository of thousands of applications that are developed by third parties outside of the project itself. (Examples include windowing systems, Internet browsers, email programs, office suites, and so forth.) In general, the project itself does not develop this software, only the framework to allow these programs to be installed (termed the Ports Collection). Applications may be installed either from source, if its licensing terms allow such redistribution (these are called ports), or as compiled binaries if allowed (these are called packages). The Ports Collection supports the latest release on the -CURRENT and -STABLE branches. Older releases are not supported and may or may not work correctly with an up-to-date ports collection