他の端末からssh接続する

ubuntu : 18.04.4(64bit)

前提:ipアドレスは固定しておく

   デフォルトゲートウェイは設定しておく

 

他の端末からssh接続出来ない場合

22番ポートが開放されていないかも?

そこでubuntuの端末でポート確認

$ netstat -ltunp4

 

22番が出ていなければ、22番ポート開放

$sudo ufw allow 22

$sudo ufw reload

 

firewallが起動していなければ以下のコマンドで起動する

$sudo ufw enable

起動し直せば再度、22番ポート開放から行なう

 

次にopenssh-serverをインストール。

$sudo apt-get install openssh-server

 

これでポート開放確認すると22番の状態がLISTENしているはず。

 

これで外部の端末からsshコマンドで確認

$ ssh 192.168.x.xx

The authenticity of host '192.168.x.xx (192.168.x.xx)' can't be established.

ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.x.xx' (ECDSA) to the list of known hosts.

hogehoge@192.168.x.xx's password: 

Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-40-generic x86_64)

 

 * Documentation:  https://help.ubuntu.com

 * Management:     https://landscape.canonical.com

 * Support:        https://ubuntu.com/advantage

 

 

 * Canonical Livepatch is available for installation.

   - Reduce system reboots and improve kernel security. Activate at:

     https://ubuntu.com/livepatch

 

0 個のパッケージがアップデート可能です。

0 個のアップデートはセキュリティアップデートです。

 

Your Hardware Enablement Stack (HWE) is supported until April 2023.

 

The programs included with the Ubuntu system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

 

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by

applicable law.

 

hogehoge@ubuntu:~$ 

って感じで接続できるはず。