Unable to change SSH port

i have edited '/etc/ssh/ssh_config'
from #Port 22
to Port 22222

and ran 'sudo systemctl restart ssh'
but when 'sudo systemctl status ssh'
it still shows it is listening on port 22

also tried editing '/etc/ssh/sshd_config' and the same result

1 Reply

To change a Linux server's SSH port, you will need to edit the /etc/ssh/sshd_config file. Edit the line that says Port and change the number to the desired port number. After saving your changes, you will need to restart the SSH service for the changes to take effect.

service ssh restart
service sshd restart

~ Andy | NexusPIPE

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct