LoginSignup
0
1

More than 3 years have passed since last update.

sshd Port番号変更

Last updated at Posted at 2020-02-22

Configの変更

vi /etc/ssh/sshd_config

#Port 22

とかかれた箇所を、#を取り、10022番を使いたい場合は

Port 10022

と変更

Selinux対策

昨今、SELinuxもONで使うことに慣れてきたようです

まずは確認
#semanage port --list | grep ssh
ssh_port_t tcp 22

#semanage port --add --type ssh_port_t --proto tcp 10022
※RHEL8.xでは導入されています。

#semanage port --list | grep ssh
ssh_port_t tcp 10022, 22
※ポートが増えていることを確認

サービスの再起動

systemctl restart sshd

確認

ログオンし確認する。

slogin -p 10022 (ID)@xxx.xxx.xxx.xxx

ログオンできれば正常に変更。
余談)
scpの場合は、

scp -P 10022 ←Pは大文字を言いたい

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