1
1

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.

sshのポート設定 - Ubuntu Server 18.04 LTS

Last updated at Posted at 2018-09-07

#はじめに
sshのポートを設定する。ファイアウォールに注意。

#手順

1: SSH設定ファイルのコピー編集

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.default

2: /etc/servicesで空いている番号を選択

NNNNN

3: /etc/ssh/sshd_configを編集

#Port 22
Port NNNNN

4: ssh.confのチェック

$ sshd -t

5: sshdの再起動

$ sudo systemctl restart sshd.service

6: ssh再接続

22番ポート指定でログインできなければOK
$ ssh -p 22 hoge@NNN.NNN.NNN.NNN

NNNNN番ポート指定でログインできればOK
$ ssh -p NNNNN hoge@NNN.NNN.NNN.NNN

#リファレンス

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?