2017年3月10日金曜日

Install openssh-server for Ubuntu

UbuntuをベースにしているBasixにopenssh-serverをインストールした。CentOSなら最小限のインストールでもopenssh serverは入っているのに、Ubuntuには入っていないようだ。

「apt-get update」してから「apt-get install openssh-server」でインストール。インストールのログは以下の通り。

$ sudo apt-get update
取得:1 http://jp.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
取得:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
取得:4 http://jp.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
取得:5 http://jp.archive.ubuntu.com/ubuntu xenial/main i386 Packages [1,196 kB]
取得:6 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [218 kB]
取得:7 http://jp.archive.ubuntu.com/ubuntu xenial/main Translation-ja [290 kB]
取得:8 http://jp.archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]
取得:9 http://jp.archive.ubuntu.com/ubuntu xenial/main i386 DEP-11 Metadata [733 kB]
取得:10 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [94.6 kB]
取得:11 http://security.ubuntu.com/ubuntu xenial-security/main i386 DEP-11 Metadata [54.7 kB]
取得:12 http://jp.archive.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons [409 kB]
取得:13 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [42.4 kB]
取得:14 http://jp.archive.ubuntu.com/ubuntu xenial/restricted i386 Packages [8,684 B]
取得:15 http://jp.archive.ubuntu.com/ubuntu xenial/restricted Translation-en [2,908 B]
取得:16 http://jp.archive.ubuntu.com/ubuntu xenial/restricted i386 DEP-11 Metadata [185 B]
取得:17 http://jp.archive.ubuntu.com/ubuntu xenial/universe i386 Packages [7,512 kB]
取得:18 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [6,804 B]
取得:19 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,272 B]
取得:20 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 DEP-11 Metadata [199 B]
取得:21 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [85.3 kB]
取得:22 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [50.3 kB]
取得:23 http://security.ubuntu.com/ubuntu xenial-security/universe i386 DEP-11 Metadata [32.1 kB]
取得:24 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [37.0 kB]
取得:25 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [2,908 B]
取得:26 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,232 B]
取得:27 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 DEP-11 Metadata [212 B]
取得:28 http://security.ubuntu.com/ubuntu xenial-security/multiverse DEP-11 64x64 Icons [29 B]
取得:29 http://jp.archive.ubuntu.com/ubuntu xenial/universe Translation-ja [1,034 kB]
取得:30 http://jp.archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]
取得:31 http://jp.archive.ubuntu.com/ubuntu xenial/universe i386 DEP-11 Metadata [3,407 kB]
取得:32 http://jp.archive.ubuntu.com/ubuntu xenial/universe DEP-11 64x64 Icons [7,448 kB]
取得:33 http://jp.archive.ubuntu.com/ubuntu xenial/multiverse i386 Packages [140 kB]
取得:34 http://jp.archive.ubuntu.com/ubuntu xenial/multiverse Translation-ja [8,704 B]
取得:35 http://jp.archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
取得:36 http://jp.archive.ubuntu.com/ubuntu xenial/multiverse i386 DEP-11 Metadata [62.4 kB]
取得:37 http://jp.archive.ubuntu.com/ubuntu xenial/multiverse DEP-11 64x64 Icons [230 kB]
取得:38 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [479 kB]
取得:39 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [194 kB]
取得:40 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main i386 DEP-11 Metadata [289 kB]
取得:41 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [184 kB]
取得:42 http://jp.archive.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages [7,164 B]
取得:43 http://jp.archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2,396 B]
取得:44 http://jp.archive.ubuntu.com/ubuntu xenial-updates/restricted i386 DEP-11 Metadata [156 B]
取得:45 http://jp.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [423 kB]
取得:46 http://jp.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [164 kB]
取得:47 http://jp.archive.ubuntu.com/ubuntu xenial-updates/universe i386 DEP-11 Metadata [140 kB]
取得:48 http://jp.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [169 kB]
取得:49 http://jp.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [6,872 B]
取得:50 http://jp.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [3,580 B]
取得:51 http://jp.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 DEP-11 Metadata [2,520 B]
取得:52 http://jp.archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons [7,765 B]
取得:53 http://jp.archive.ubuntu.com/ubuntu xenial-backports/main i386 Packages [4,660 B]
取得:54 http://jp.archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3,200 B]
取得:55 http://jp.archive.ubuntu.com/ubuntu xenial-backports/main i386 DEP-11 Metadata [3,328 B]
取得:56 http://jp.archive.ubuntu.com/ubuntu xenial-backports/main DEP-11 64x64 Icons [29 B]
取得:57 http://jp.archive.ubuntu.com/ubuntu xenial-backports/restricted i386 Packages [64 B]
取得:58 http://jp.archive.ubuntu.com/ubuntu xenial-backports/restricted Translation-en [64 B]
取得:59 http://jp.archive.ubuntu.com/ubuntu xenial-backports/restricted i386 DEP-11 Metadata [193 B]
取得:60 http://jp.archive.ubuntu.com/ubuntu xenial-backports/universe i386 Packages [2,508 B]
取得:61 http://jp.archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [1,216 B]
取得:62 http://jp.archive.ubuntu.com/ubuntu xenial-backports/universe i386 DEP-11 Metadata [212 B]
取得:63 http://jp.archive.ubuntu.com/ubuntu xenial-backports/universe DEP-11 64x64 Icons [29 B]
取得:64 http://jp.archive.ubuntu.com/ubuntu xenial-backports/multiverse i386 Packages [64 B]
取得:65 http://jp.archive.ubuntu.com/ubuntu xenial-backports/multiverse Translation-en [64 B]
取得:66 http://jp.archive.ubuntu.com/ubuntu xenial-backports/multiverse i386 DEP-11 Metadata [216 B]
取得:67 http://jp.archive.ubuntu.com/ubuntu xenial-backports/multiverse DEP-11 64x64 Icons [29 B]
30.8 MB を 42秒 で取得しました (722 kB/s)
AppStream cache update completed, but some metadata was ignored due to errors.
パッケージリストを読み込んでいます... 完了


$ sudo apt-get install openssh-server
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
  gir1.2-appindicator3-0.1 gir1.2-json-1.0 gir1.2-timezonemap-1.0
  gir1.2-xkl-1.0 libtimezonemap-data libtimezonemap1 python3-gi-cairo
これを削除するには 'sudo apt autoremove' を利用してください。
以下の追加パッケージがインストールされます:
  openssh-client openssh-sftp-server ssh-import-id
提案パッケージ:
  ssh-askpass libpam-ssh keychain monkeysphere rssh molly-guard
以下のパッケージが新たにインストールされます:
  openssh-server openssh-sftp-server ssh-import-id
以下のパッケージはアップグレードされます:
  openssh-client
アップグレード: 1 個、新規インストール: 3 個、削除: 0 個、保留: 364 個。
1,085 kB のアーカイブを取得する必要があります。
この操作後に追加で 1,254 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main i386 openssh-client i386 1:7.2p2-4ubuntu2.1 [651 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main i386 openssh-sftp-server i386 1:7.2p2-4ubuntu2.1 [44.0 kB]
取得:3 http://jp.archive.ubuntu.com/ubuntu xenial-updates/main i386 openssh-server i386 1:7.2p2-4ubuntu2.1 [380 kB]
取得:4 http://jp.archive.ubuntu.com/ubuntu xenial/main i386 ssh-import-id all 5.5-0ubuntu1 [10.2 kB]
1,085 kB を 1秒 で取得しました (677 kB/s)
パッケージを事前設定しています ...
(データベースを読み込んでいます ... 現在 127199 個のファイルとディレクトリがインストールされています。)
.../openssh-client_1%3a7.2p2-4ubuntu2.1_i386.deb を展開する準備をしています ...
openssh-client (1:7.2p2-4ubuntu2.1) で (1:7.2p2-4 に) 上書き展開しています ...
以前に未選択のパッケージ openssh-sftp-server を選択しています。
.../openssh-sftp-server_1%3a7.2p2-4ubuntu2.1_i386.deb を展開する準備をしています ...
openssh-sftp-server (1:7.2p2-4ubuntu2.1) を展開しています...
以前に未選択のパッケージ openssh-server を選択しています。
.../openssh-server_1%3a7.2p2-4ubuntu2.1_i386.deb を展開する準備をしています ...
openssh-server (1:7.2p2-4ubuntu2.1) を展開しています...
以前に未選択のパッケージ ssh-import-id を選択しています。
.../ssh-import-id_5.5-0ubuntu1_all.deb を展開する準備をしています ...
ssh-import-id (5.5-0ubuntu1) を展開しています...
man-db (2.7.5-1) のトリガを処理しています ...
ureadahead (0.100.0-19) のトリガを処理しています ...
ureadahead will be reprofiled on next reboot
systemd (229-4ubuntu4) のトリガを処理しています ...
ufw (0.35-0ubuntu2) のトリガを処理しています ...
openssh-client (1:7.2p2-4ubuntu2.1) を設定しています ...
openssh-sftp-server (1:7.2p2-4ubuntu2.1) を設定しています ...
openssh-server (1:7.2p2-4ubuntu2.1) を設定しています ...
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:bDqlSBH3mULWSZq2nZuY/xImSNAyRC3IFv+jTFzyODI root@XXXX (RSA)
Creating SSH2 DSA key; this may take some time ...
1024 SHA256:vnghI36BGC5qoxTnQffH5j+L/v0/nZbRcEMbI0ExSGQ root@XXXX (DSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:xhub9c45SB4qd1ycsbfEoVpstMvjCS7LxDE5gyhLxLk root@XXXX (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:oKbA55fSUQBBRDBqhf/h4mF2DU5f06AxgDlmUDlMJYk root@XXXX (ED25519)
ssh-import-id (5.5-0ubuntu1) を設定しています ...
ureadahead (0.100.0-19) のトリガを処理しています ...
systemd (229-4ubuntu4) のトリガを処理しています ...
ufw (0.35-0ubuntu2) のトリガを処理しています ...

openssh-serverインストール直後のメモリー使用量は以下のような感じ。

$ free
              total        used        free      shared  buff/cache   available
Mem:        7974480      201748     7036564       37092      736168     7680956
Swap:       4194052           0     4194052

ifconfigで割り当てられているIPアドレスを調べて別のPCからSSHでログインしてみる。ログイン時に以下のように表示された。

Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-72-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

0 個のパッケージがアップデート可能です。
0 個のアップデートはセキュリティアップデートです。

Basixとは表示されず、Ubuntuと表示されるらしい。

0 件のコメント:

コメントを投稿