OpenSSHをインストールする!(Debian 12)

Debian 12に、OpenSSHをインストールします。

動作確認した環境を確認する!

動作確認した環境を確認します。

$ hostnamectl
 Static hostname: vmsdeb02
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: d4da43afd557413bafb2c5c34a63131d
         Boot ID: 92301b84c4554ddfb96a752c450dcb84
  Virtualization: oracle
Operating System: Debian GNU/Linux 12 (bookworm)  
          Kernel: Linux 6.1.0-11-amd64
    Architecture: x86-64
 Hardware Vendor: innotek GmbH
  Hardware Model: VirtualBox
Firmware Version: VirtualBox

OpenSSHをインストールする!

rootユーザで、標準のリポジトリからOpenSSHをインストールします。

# apt install openssh-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  openssh-sftp-server runit-helper
Suggested packages:
  molly-guard monkeysphere ssh-askpass ufw
The following NEW packages will be installed:
  openssh-server openssh-sftp-server runit-helper
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 527 kB of archives.
After this operation, 2,214 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://deb.debian.org/debian bookworm/main amd64 openssh-sftp-server amd64 1:9.2p1-2 [65.4 kB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 runit-helper all 2.15.2 [6,520 B]
Get:3 http://deb.debian.org/debian bookworm/main amd64 openssh-server amd64 1:9.2p1-2 [455 kB]
Fetched 527 kB in 13s (41.2 kB/s)       
Preconfiguring packages ...
Selecting previously unselected package openssh-sftp-server.
(Reading database ... 151542 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a9.2p1-2_amd64.deb ...
Unpacking openssh-sftp-server (1:9.2p1-2) ...
Selecting previously unselected package runit-helper.
Preparing to unpack .../runit-helper_2.15.2_all.deb ...
Unpacking runit-helper (2.15.2) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a9.2p1-2_amd64.deb ...
Unpacking openssh-server (1:9.2p1-2) ...
Setting up runit-helper (2.15.2) ...
Setting up openssh-sftp-server (1:9.2p1-2) ...
Setting up openssh-server (1:9.2p1-2) ...

Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:S0txz1TGQBxmVbq38boOdJiIqwmEFoeR+KmWESxDHlM root@vmsdeb02 (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:6lr173yYmHL85vcDe2WIEdh2AD0PJsFQkL4jA+Ht4cU root@vmsdeb02 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:tOzXKojemCgqrErum3d+t1E4YETs9INM26L4t7LnSSQ root@vmsdeb02 (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
ssh.socket is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.11.2-2) ...

おわりに

Debian 12では、標準のリポジトリからOpenSSHをインストールすることができます。

関連記事