Install ssh di Ubuntu 20.04

Dari Dokumentasi Robie
Revisi sejak 19 September 2023 06.34 oleh Robie (bicara | kontrib)
Loncat ke navigasi Loncat ke pencarian

Anggap saja kita baru pertama kali menginstall sistem operasi linux dan belum melakukan konfigurasi apa-apa setelah berhasil melakukan install. SSH (Secure Shell) sendiri adalah protocol yang digunakan untuk melakukan remote server yang menggunakan ip address dan aplikasi ssh sebagai akses masuknya. Untuk melakukan instalasi SSH dapat melakukan perintah berikut:

Install

$sudo apt-get update
$sudo apt-get install openssh-server
$ sudo apt-get install openssh-server
[sudo] password for robie: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  openssh-client openssh-sftp-server
Suggested packages:
  keychain libpam-ssh monkeysphere ssh-askpass molly-guard
The following packages will be upgraded:
  openssh-client openssh-server openssh-sftp-server
3 upgraded, 0 newly installed, 0 to remove and 158 not upgraded.
Need to get 1100 kB of archives.
After this operation, 9216 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://id.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-sftp-server amd64 1:8.2p1-4ubuntu0.9 [51.7 kB]
Get:2 http://id.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-server amd64 1:8.2p1-4ubuntu0.9 [377 kB]
Get:3 http://id.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-client amd64 1:8.2p1-4ubuntu0.9 [671 kB]
Fetched 1100 kB in 1min 47s (10.3 kB/s)                                        
Preconfiguring packages ...
(Reading database ... 73081 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a8.2p1-4ubuntu0.9_amd64.deb ...
Unpacking openssh-sftp-server (1:8.2p1-4ubuntu0.9) over (1:8.2p1-4ubuntu0.7) ...
Preparing to unpack .../openssh-server_1%3a8.2p1-4ubuntu0.9_amd64.deb ...
Unpacking openssh-server (1:8.2p1-4ubuntu0.9) over (1:8.2p1-4ubuntu0.7) ...
Preparing to unpack .../openssh-client_1%3a8.2p1-4ubuntu0.9_amd64.deb ...
Unpacking openssh-client (1:8.2p1-4ubuntu0.9) over (1:8.2p1-4ubuntu0.7) ...
Setting up openssh-client (1:8.2p1-4ubuntu0.9) ...
Setting up openssh-sftp-server (1:8.2p1-4ubuntu0.9) ...
Setting up openssh-server (1:8.2p1-4ubuntu0.9) ...
rescue-ssh.target is a disabled or a static unit, not starting it.
Processing triggers for systemd (245.4-4ubuntu3.17) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ufw (0.36-6ubuntu1) ...
robie@robie:~$ 

Restart

/etc/init.d/ssh restart


Untuk melakukan remote SSH kita perlu mengetahui IP Address yang akan di remote. Cara melihat IP Address di Linux Ubuntu 20.04 dengan mengetikan perintah


ifconfig lalu enter

hasilnya akan terlihat seperti berikut


~$ ifconfig

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

       inet 192.168.122.140  netmask 255.255.255.0  broadcast 192.168.122.255

       inet6 fe80::a00:27ff:febf:ea8e  prefixlen 64  scopeid 0x20<link>

       ether 08:00:27:bf:ea:8e  txqueuelen 1000  (Ethernet)

       RX packets 16745  bytes 22061193 (22.0 MB)

       RX errors 0  dropped 908  overruns 0  frame 0

       TX packets 11177  bytes 929689 (929.6 KB)

       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

       inet 127.0.0.1  netmask 255.0.0.0

       inet6 ::1  prefixlen 128  scopeid 0x10<host>

       loop  txqueuelen 1000  (Local Loopback)

       RX packets 4137  bytes 195200 (195.2 KB)

       RX errors 0  dropped 0  overruns 0  frame 0

       TX packets 4137  bytes 195200 (195.2 KB)

       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0