5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu 16.04 LTSでssh.serviceがunrecognized serviceと言われたときの対処法

Posted at

事の始まり

Ubuntu 16.04 LTSが動いているPCに対してSSH接続を試みたところ、以下のようなエラーを吐いて拒否された。

$ ssh hoge@192.168.2.103
ssh: connect to host 192.168.2.103 port 22: Connection refused

「どうせsshdが落ちてるんだろw」

そう思ってサービスの状態を確認しようとしたところ…

$ sudo service sshd status
●sshd.service
  Loaded: not-found (Reason: No such file or directory)
  Active: inactive (dead)

どうやら認識すらされてないようです。

対処法

openssh-serverを再インストールしましょう。

$ sudo apt-get purge openssh-server
$ sudo apt-get install openssh-server

これで起動できるようになったはずです。それでは、快適なインフラライフを…:thumbsup:

$ sudo service sshd start
$ sudo service sshd status
●ssh.service - OpenBSD Secure Shell Server
  Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
  Active: active (running) since ...

参考

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?