E
E
Egor Sh2016-03-17 12:59:15
SSH
Egor Sh, 2016-03-17 12:59:15

How to change the ssh port on the server and successfully connect to it?

Changed the port from 22 to 2233 in sshd_config, saved the file, restarted ssh - sudo service ssh restart,
using the ss -nlput | grep sshd checked that the port is correct, I try to connect to a server with a new port like ssh -p 2233 [email protected] and writes that connection refused, I change it back to 22 and everything works again, I already added 2233 to iptables, I also added it to authorized_keys public key from local computer, what didn't I do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
veselovi4, 2016-03-17
@veselovi4

just in case, write two ports in sshd_config
... so that at least one can be reached , it
is written directly under each other
Port 22
Port 2233

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question