[Peppermint] SSH サーバをインストールしてリモートログインできるようにする方法

前書き

今日はペパーミントに SSH サーバ (OpenSSH) をインストールする方法を書いておきます。

ペパーミントに SSH サーバをインストールしようと思った理由

ペパーミントはデスクトップ用途で使っていて、サーバー用途では使う予定はありませんが、ちょっとした設定やちょっとした何かをインストールする場合に、他のマシンから ssh でログインして作業できると楽だと思ったから。

OpenSSH サーバのインストール

コマンド操作でインストールして行きますが、まずはパッケージの確認から。

$ aptitude search openssh
p libconfig-model-openssh-perl - configuration file editor for OpenSsh 
p libnet-openssh-compat-perl - collection of compatibility modules for Net::Open
p libnet-openssh-perl - Perl SSH client package implemented on top of Ope
p openssh-blacklist - list of default blacklisted OpenSSH RSA and DSA k
p openssh-blacklist-extra - list of non-default blacklisted OpenSSH RSA and D
i openssh-client - secure shell (SSH) client, for secure access to r
p openssh-server - secure shell (SSH) server, for secure access from
p openssh-sftp-server - secure shell (SSH) sftp server module, for SFTP a
p razorqt-openssh-askpass - OpenSSH helper component for Razor-qt desktop env
$ aptitude show openssh-server
Package: openssh-server 
State: not installed
Multi-Arch: foreign
Version: 1:6.6p1-2ubuntu2.8
Priority: optional
Section: net
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Uncompressed Size: 1,020 k
Depends: libaudit1 (>= 1:2.2.1), libc6 (>= 2.17), libck-connector0 (>= 0.2.1), libcomerr2 (>=
 1.01), libdbus-1-3 (>= 1.0.2), libgssapi-krb5-2 (>= 1.10+dfsg~), libkrb5-3 (>=
 1.6.dfsg.2), libpam0g (>= 0.99.7.1), libselinux1 (>= 1.32), libssl1.0.0 (>= 1.0.1),
 libwrap0 (>= 7.6-4~), zlib1g (>= 1:1.1.4), debconf (>= 0.5) | debconf-2.0,
 init-system-helpers (>= 1.13~), openssh-client (= 1:6.6p1-2ubuntu2.8), sysv-rc (>=
 2.88dsf-24) | file-rc (>= 0.8.16), libpam-runtime (>= 0.76-14), libpam-modules (>=
 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), lsb-base (>= 4.1+Debian3), procps,
 openssh-sftp-server
Recommends: xauth, ncurses-term, ssh-import-id
Suggests: ssh-askpass, rssh, molly-guard, ufw, monkeysphere
Conflicts: sftp, ssh-socks, ssh2
Replaces: ssh, ssh-krb5
Provides: ssh-server
Description: secure shell (SSH) server, for secure access from remote machines
 This is the portable version of OpenSSH, a free implementation of the Secure Shell protocol as
 specified by the IETF secsh working group. 
 
 Ssh (Secure Shell) is a program for logging into a remote machine and for executing commands
 on a remote machine. It provides secure encrypted communications between two untrusted hosts
 over an insecure network. X11 connections and arbitrary TCP/IP ports can also be forwarded
 over the secure channel. It can be used to provide applications with a secure communication
 channel. 
 
 This package provides the sshd server. 
 
 In some countries it may be illegal to use any encryption at all without a special permit. 
 
 sshd replaces the insecure rshd program, which is obsolete for most purposes.
Homepage: http://www.openssh.org/

$

それではインストールしていきましょう。

$ sudo apt-get install openssh-server
[sudo] password for nobi: 
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following packages were automatically installed and are no longer required:
 libspeechd2 linux-headers-3.16.0-37 linux-headers-3.16.0-37-generic
 linux-headers-3.16.0-46 linux-headers-3.16.0-46-generic
 linux-image-3.16.0-37-generic linux-image-3.16.0-46-generic
 linux-image-extra-3.16.0-37-generic linux-image-extra-3.16.0-46-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
 ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:
 ssh-askpass rssh molly-guard ufw monkeysphere
The following NEW packages will be installed:
 ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 upgraded, 4 newly installed, 0 to remove and 4 not upgraded.
Need to get 613 kB of archives.
After this operation, 3,430 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://jp.archive.ubuntu.com/ubuntu/ trusty/main ncurses-term all 5.9+20140118-1ubuntu1 [243 kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-sftp-server i386 1:6.6p1-2ubuntu2.8 [35.5 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-server i386 1:6.6p1-2ubuntu2.8 [326 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu/ trusty/main ssh-import-id all 3.21-0ubuntu1 [9,624 B]
Fetched 613 kB in 2s (220 kB/s) 
Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... 261431 files and directories currently installed.)
Preparing to unpack .../ncurses-term_5.9+20140118-1ubuntu1_all.deb ...
Unpacking ncurses-term (5.9+20140118-1ubuntu1) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a6.6p1-2ubuntu2.8_i386.deb ...
Unpacking openssh-sftp-server (1:6.6p1-2ubuntu2.8) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a6.6p1-2ubuntu2.8_i386.deb ...
Unpacking openssh-server (1:6.6p1-2ubuntu2.8) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_3.21-0ubuntu1_all.deb ...
Unpacking ssh-import-id (3.21-0ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up ncurses-term (5.9+20140118-1ubuntu1) ...
Setting up openssh-sftp-server (1:6.6p1-2ubuntu2.8) ...
Setting up openssh-server (1:6.6p1-2ubuntu2.8) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
ssh start/running, process 12135
Setting up ssh-import-id (3.21-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
$

これでインストール完了です。

他のマシンから ssh でインストールできることを確認しておきましょう。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください