CLICK HERE FOR THOUSANDS OF FREE BLOGGER TEMPLATES »

Senin, 22 Juni 2009

Menggunakan remote SSH Login

Introduction Pendahuluan

SSH is a protocol that allows computers to communicate with each other over encrypted connections. SSH adalah sebuah protokol yang memungkinkan komputer untuk berkomunikasi satu sama lain melalui sambungan terenkripsi. An SSH client is used to log in to a remote machine (running an SSH server) and allows the execution of commands on that machine. Klien SSH yang digunakan untuk login ke komputer remote (menjalankan server SSH) dan memungkinkan pelaksanaan perintah pada komputer.

Examples of what SSH can be used for are: Contoh-contoh dari apa SSH dapat digunakan untuk adalah:

  • Access to the UNIX-like environment from a Windows machine; Akses ke UNIX seperti lingkungan dari mesin Windows;
  • Work from home with access to your filestore; Bekerja dari rumah dengan akses ke filestore;
  • Copying files between your CS filestore and another machine; Menyalin file antara lain CS filestore dan mesin;
  • Read restricted web pages (such as 'csonly' parts of the intranet). Dibatasi membaca halaman web (seperti 'csonly' bagian Intranet).

Other protocols, such as RSH and Telnet, allow computers to communicate in a similar way to SSH. Protokol lainnya, seperti RSH dan Telnet, memungkinkan komputer untuk berkomunikasi dalam cara yang sama ke SSH. These protocols are now considered insecure and machines in the department no longer allow RSH or Telnet connections. Protokol sekarang ini dianggap aman dan mesin di departemen tidak membolehkan RSH atau Telnet koneksi.

What You Will Need Apakah Anda Akan Perlu

You will need an SSH client for your system: Anda akan memerlukan sebuah klien SSH untuk sistem anda:

  • OpenSSH is available for Linux and other UNIX-like operating systems. OpenSSH tersedia untuk Linux dan UNIX lainnya seperti sistem operasi.

    Pre-packaged versions are available for Linux distributions: Pra-versi yang tersedia paket untuk distribusi Linux:

    • For Redhat the package is called "openssh" Untuk Redhat paket disebut "openssh"
    • For Debian the package is called "ssh" Untuk paket Debian yang disebut "ssh"
  • PuTTY is a graphical SSH client for Windows. Putty adalah grafis klien SSH untuk Windows. There is also a Linux port available in the Debian package archive. Terdapat pula port Linux yang tersedia dalam paket Debian arsip.

Remote Logins to Computer Science Machines Remote Login ke Ilmu Komputer Machines

The following machines have been set aside for remote logins: Berikut mesin telah dikhususkan untuk login jauh:

  • n9plus.cs.man.ac.uk (130.88.199.8): Use this Solaris server if you do not need to use Linux. n9plus.cs.man.ac.uk (130.88.199.8): Gunakan ini Solaris server jika Anda tidak perlu menggunakan Linux. Solaris is a UNIX-like operating system and has many features and commands in common with Linux. Solaris adalah UNIX seperti sistem operasi dan memiliki banyak fitur dan perintah dalam umum dengan Linux.
  • rs0.cs.man.ac.uk (130.88.199.3): Use this Linux server if you need to use Linux. rs0.cs.man.ac.uk (130.88.199.3): Gunakan ini jika server Linux Anda harus menggunakan Linux.

Using SSH Menggunakan SSH

Shell login Shell login

For an interactive session at the command prompt (shell) the syntax is: Untuk sesi interaktif pada command prompt (shell) sintaks adalah:

ssh user @ host ssh user @ host

user pengguna
Your teaching domain Unix login name. Anda mengajar Unix domain nama login.
host tuan rumah
The machine to login to. Mesin untuk login.

For example, to login to rs0.cs.man.ac.uk as user smithj2 : Misalnya, untuk login ke rs0.cs.man.ac.uk sebagai pengguna smithj2:

 $ ssh smithj2@rs0.cs.man.ac.uk $ Ssh smithj2@rs0.cs.man.ac.uk

A message similar to the following may be displayed: Sebuah pesan yang mirip dengan yang berikut ini mungkin ditampilkan:

 The authenticity of host 'rs0.cs.man.ac.uk (130.88.199.3)' can't be established. Keaslian host 'rs0.cs.man.ac.uk (130.88.199.3)' tidak dapat didirikan. 
RSA key fingerprint is bb:9a:2e:70:c1:9e:b2:73:e9:a0:3b:5f:a0:eb:2c:8a. RSA key fingerprint adalah bb: 9a: 2e: 70: c1: 9e: b2: 73: e9: A0: 3b: 5f: A0: eb: 2c: 8A.
Are you sure you want to continue connecting (yes/no)? Apakah Anda yakin ingin melanjutkan connecting (yes / no)?

This is a check to make sure that another machine is not masquerading as the remote machine. Ini adalah cek untuk memastikan bahwa komputer lain yang tidak jauh masquerading sebagai mesin. In most cases it is safe to say 'yes'. Dalam kasus ini paling aman untuk berkata 'ya'.

Enter your password at the prompt and you will be presented with your shell command line: Masukkan sandi Anda pada prompt dan anda akan diberikan shell dengan perintah baris:

 smithj2@rs0.cs.man.ac.uk's password: smithj2@rs0.cs.man.ac.uk 's password: 
Last login: Sun Sep 14 14:11:57 2003 from myhost.mydomain.com Login terakhir: Sun Sep 14 14:11:57 2003 dari myhost.mydomain.com
Your Operating System is Linux Anda adalah Sistem Operasi Linux
Welcome to ... Selamat datang ... the teaching domain pengajaran domain
Checking your file quota... Memeriksa file Anda kuota ... Okay Okay
smithj2@rs0-> smithj2 @ rs0->

Login over a slow connection Login melalui koneksi yang lambat

To enable compression add the '-C' option: Untuk mengaktifkan kompresi menambahkan '-C' pilihan:

ssh -C user @ host ssh-C user @ host

This is useful if you are logging in from home on a dialup connection. Ini berguna jika anda masuk dari rumah pada koneksi dialup.

Forward X connections X maju sambungan

If you want to run programs with a graphical interface (you need to be running X on your machine): Jika Anda ingin menjalankan program dengan antarmuka grafis (Anda harus menjalankan X pada komputer Anda):

ssh -X user @ host ssh-X user @ host

Example: Log in and open a document in 'gv': Contoh: Masuk dan membuka dokumen dalam 'GV':

 $ ssh -X smithj2@rs0.cs.man.ac.uk $ Ssh-X smithj2@rs0.cs.man.ac.uk
smithj2@rs0.cs.man.ac.uk's password: smithj2@rs0.cs.man.ac.uk 's password:
Last login: Sun Sep 14 14:11:57 2003 from myhost.mydomain.com Login terakhir: Sun Sep 14 14:11:57 2003 dari myhost.mydomain.com
Your Operating System is Linux Anda adalah Sistem Operasi Linux
Welcome to ... Selamat datang ... the teaching domain pengajaran domain
Checking your file quota... Memeriksa file Anda kuota ... Okay Okay
smithj2@rs0-> gv report.ps smithj2 @ rs0-> GV report.ps

Port forwarding Port forwarding

Local port forwarding is used to access a service on a remote machine by accessing the local machine. Port forwarding lokal yang digunakan untuk mengakses layanan di remote oleh komputer yang mengakses komputer lokal. Start port forwarding with the syntax: Mulai port forwarding dengan sintaks:

ssh -L local_port : remote_host : remote_port user @ host ssh-L local_port: remote_host: remote_port user @ host

local_port local_port
Port to forward from the local machine. Port untuk maju dari mesin lokal. Any unused port number between 1024 and 49151 may be used. Any unused nomor port antara 1024 dan 49151 yang dapat digunakan.
remote_host remote_host
The machine providing the service that is being forwarded. Komputer yang menyediakan layanan yang sedang diteruskan.
remote_port remote_port
The port on remote_host to forward to. Pelabuhan di remote_host untuk meneruskan ke. This is the port that the service is listening on. Pelabuhan ini adalah bahwa layanan ini pada mendengarkan. For example, port 80 is most commonly used by HTTP servers. Sebagai contoh, port 80 yang paling sering digunakan oleh HTTP server.

To access restricted parts of the Computer Science website: Dibatasi untuk mengakses bagian situs web Ilmu Komputer:

 $ ssh -L 8000:www.cs.man.ac.uk:80 smithj2@rs0.cs.man.ac.uk $ Ssh-L 8000: www.cs.man.ac.uk:80 smithj2@rs0.cs.man.ac.uk
smithj2@rs0.cs.man.ac.uk's password: smithj2@rs0.cs.man.ac.uk 's password:
Last login: Tue Sep 16 15:37:24 2003 from myhost.mydomain.com Terakhir login: Tue Sep 16 15:37:24 2003 dari myhost.mydomain.com
Your Operating System is Linux Anda adalah Sistem Operasi Linux
Welcome to ... Selamat datang ... the teaching domain pengajaran domain
Checking your file quota... Memeriksa file Anda kuota ... Okay Okay
smithj2@rs0-> smithj2 @ rs0->

http://www.cs.man.ac.uk/ can now be accessed through http://localhost:8000/ . http://www.cs.man.ac.uk/ kini dapat diakses melalui http://localhost:8000/.

Go to http://localhost:8000/csonly/php/services/ to view the Computing Facilities web page. Menuju ke http://localhost:8000/csonly/php/services/ untuk melihat Komputasi Fasilitas halaman web.

To access news from the department's news server you need to add a local port forward to newshost.cs.man.ac.uk:119. Untuk mengakses berita dari departemen news server anda harus menambahkan port lokal untuk maju newshost.cs.man.ac.uk: 119.

Using PuTTY Menggunakan Putty

Shell Login Shell Login

  1. Run putty. Mendempol berjalan. You will see the PuTTY Configuration window. Anda akan melihat jendela Putty Configuration.
    Putty Konfigurasi jendela
  2. In the Session category enter the Host Name (eg: rs0.cs.man.ac.uk). Sesi dalam kategori masukkan Nama Host (misalnya: rs0.cs.man.ac.uk).
  3. Select the SSH Protocol and make sure the Port is set to 22 . Pilih SSH Protokol dan pastikan Port yang diatur ke 22.
    Host protokol dan pengaturan
  4. Select Open at the bottom of the window. Pilih Buka di bagian bawah jendela. A dialog box may be displayed asking you to confirm the authenticity of the host. Sebuah kotak dialog yang ditampilkan mungkin meminta Anda untuk mengkonfirmasi keaslian host. This is a check to make sure that another machine is not masquerading as the remote machine. Ini adalah cek untuk memastikan bahwa komputer lain yang tidak jauh masquerading sebagai mesin. In most cases it is safe to click Yes . Dalam kasus ini paling aman untuk klik Yes.
    Dialog otentikasi host
  5. Enter your teaching domain Unix login name at the 'login as:' prompt in the terminal window . Masukkan domain mengajar Unix nama login di 'login sebagai:' prompt di jendela terminal.
  6. Enter your password when prompted. Masukkan sandi Anda jika diminta.
    Jendela terminal login

Setting The Terminal Font The Terminal pengaturan font

If the default font for the PuTTY terminal is too small you can change it in the configuration dialog. Jika default font untuk mendempol terminal terlalu kecil Anda dapat mengubahnya dalam dialog konfigurasi.

  1. Select Appearance from the Window category on the left of the configuration dialog. Pilih tampilan dari Jendela kategori di sebelah kiri dari dialog konfigurasi.
    Pengaturan tampilan
  2. In the Set the font used in the terminal window section, click on Change... and use the font dialog to select a readable font. Dalam Mengatur font yang digunakan dalam jendela terminal, klik pada Ubah ... dan menggunakan font dialog untuk memilih font dibaca.

Login over a slow connection Login melalui koneksi yang lambat

For slow connections PuTTY can use compression to speed up data transfer. Lambat untuk koneksi Putty dapat menggunakan kompresi untuk mempercepat transfer data.

  1. Select SSH from the Connection category on the left of the configuration dialog. Pilih Koneksi SSH dari kategori di sebelah kiri dari dialog konfigurasi.
  2. Tick the Enable compression box. Tick yang Aktifkan kompresi kotak.
    Konfigurasi untuk SSH kompresi

Forward X connections X maju sambungan

X forwarding is used to allow graphical applications from the remote host to be displayed on the local host. X forwarding digunakan untuk membolehkan grafis aplikasi dari server yang akan ditampilkan pada host lokal.

Getting an X server for Windows Memperoleh X server untuk Windows

You need to be running an X server on your machine to display remote programs: Anda harus menjalankan X server pada komputer Anda untuk menampilkan jauh program:

  • Exceed is a commercial X Server. Melebihi adalah komersial X Server. It is available on the Windows machines in the department and on the MCC public cluster PCs. Ini tersedia di mesin Windows di departemen dan di PKS publik klaster PC.
  • Cygwin/XFree86 is a port of XFree86 to Microsoft Windows. Cygwin/XFree86 adalah pelabuhan XFree86 untuk Microsoft Windows. It runs on top of Cygwin and is installable using Cygwin's package installer. Ia berjalan di atas Cygwin dan installable menggunakan Cygwin dari paket installer.

X forwarding in PuTTY X forwarding di dempul

  1. Select Tunnels from the Connection: SSH category on the left of the configuration dialog. Pilih terowongan dari Sambungan: SSH kategori di sebelah kiri dari dialog konfigurasi.
  2. Tick the box marked Enable X11 forwarding the the X11 forwarding section. Tick kotak bertanda Aktifkan X11 forwarding the X11 forwarding bagian.
    Konfigurasi untuk X forwarding

Port forwarding Port forwarding

Local port forwarding is used to access a service on a remote machine by accessing the local machine. Port forwarding lokal yang digunakan untuk mengakses layanan di remote oleh komputer yang mengakses komputer lokal.

  1. Select Tunnels from the Connection: SSH category on the left of the configuration dialog. Pilih terowongan dari Sambungan: SSH kategori di sebelah kiri dari dialog konfigurasi.
  2. Under Add new forwarded port: Tambahkan bawah baru diteruskan port:
    1. Enter the local port to forward in the Source port box. Masukkan port lokal untuk maju dalam kotak Sumber pelabuhan. Any unused port number between 1024 and 49151 may be used. Example: 8000 Any unused nomor port antara 1024 dan 49151 yang dapat digunakan. Contoh: 8000
    2. Enter the name of the machine providing the service, followed by a colon (':', withouth quotes) and the port to forward to in the Destination box. Example: www.cs.man.ac.uk:80 Masukkan nama komputer yang menyediakan layanan ini, diikuti oleh sebuah titik-dua (':', withouth tanda kutip) dan port untuk meneruskan ke dalam kotak Tujuan. Contoh: www.cs.man.ac.uk:80
      Port forwarding
    3. Select Local (underneath the Destination box). Pilih Lokal (Tujuan kotak di bawah).
    4. Click Add to add it to the Forwarded ports: list. Klik Tambah untuk menambahkan ke Diteruskan port: daftar.
      Port forwarding

The example would allow access to www.cs.man.ac.uk using localhost:8000 . Contoh akan memungkinkan akses ke www.cs.man.ac.uk menggunakan localhost: 8000.

Copying Files Using scp Menyalin File Menggunakan scp

A program called "scp" can be used to transfer files from one machine to another using the SSH protocol. Suatu program yang disebut "scp" dapat digunakan untuk mentransfer file dari satu komputer ke lain menggunakan protokol SSH.

For Windows, "PSCP.EXE" is available from the PuTTY download page and has an interface very similar to the scp command. Untuk Windows, "PSCP.EXE" tersedia dari Putty halaman download dan memiliki antarmuka yang sangat mirip dengan perintah scp.

scp user @ host : file1 file2 scp user @ host: file1 file2

scp file1 user @ host : file2 scp file1 user @ host: file2

To copy the file 'report.ps' from the home directory of smithj2 to the current directory: Untuk menyalin file 'report.ps' dari direktori home dari smithj2 ke dalam direktori:

 $ scp smithj2@rs0.cs.man.ac.uk:~/report.ps . $ Scp smithj2@rs0.cs.man.ac.uk: ~ / report.ps.
smithj2@rs0.cs.man.ac.uk's password: smithj2@rs0.cs.man.ac.uk 's password:
report.ps 100% 164KB 4.2KB/s 00:38 report.ps 100% 164KB 4.2KB / s 00:38

To copy all files in the 'test' directory to smithj2 's 'test' directory: Untuk menyalin semua file dalam 'test' ke direktori smithj2 's' test' direktori:

 $ scp test/* smithj2@rs0.cs.man.ac.uk:~/test/ $ Scp uji / * smithj2@rs0.cs.man.ac.uk: ~ / test /
smithj2@rs0.cs.man.ac.uk's password: smithj2@rs0.cs.man.ac.uk 's password:
file1 100% 26KB 3.3MB/s 00:00 file1 100% 26KB 3.3MB / s 00:00
file2 100% 3055 565.7KB/s 00:00 file2 100% 3055 565.7KB / s 00:00
file3 100% 191 323.8KB/s 00:00 file3 100% 191 323.8KB / s 00:00

0 komentar: