SSHサーバーが動かない

デスクトップで使っているxubuntu 22.10にはsshサーバーをインストールしていなかった。

改めてインストール
$ sudo apt install openssh-server

パスワードでのアクセスできるようにする。
$ sudo emacs -nw /etc/ssh/sshd_config

PasswordAuthentication yes
sshd_configファイルの上記箇所のコメント#を外して、パスワードによる認証を許可

sshサーバー再起動
$ sudo service sshd restart
Failed to restart sshd.service: Unit sshd.service not found.
なぜ?

$ sudo systemctl start sshd.service
Failed to start sshd.service: Unit sshd.service not found.
なぜ?

結果的には下記のコマンドで登録し、サービスを起動できた。
$ sudo systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
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.

$ sudo systemctl start ssh
→sshサーバー起動

$ sudo systemctl status ssh
→sshサーバーの状態確認
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/ssh.service.d
└─00-socket.conf
Active: active (running) since Sat 202x-0x-xx 1x:1x:xx JST; xs ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 12426 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 12427 (sshd)
Tasks: 1 (limit: 19036)
Memory: 2.2M
CPU: 25ms
CGroup: /system.slice/ssh.service
└─12427 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

インストールしただけでは起動しないのか。
再起動したら立ち上がったのかどうかは判らず。

この記事が気に入ったらサポートをしてみませんか?