Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

事の始まり

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 ...

参考

https://askubuntu.com/questins/265982/unable-to-start-sshd

musaprg
スニペット類の著作権は「CC0 1.0」です
misw
プログラミング・2D/3DCG・DTM・シナリオ・動画製作等を一手に引き受ける、早稲田大学公認のデジタル創作サークル
https://misw.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした