Changing ssh port

How to change ssh port.
Open the file /etc/ssh/sshd_config with your favourite text editor. For example:

nano /etc/ssh/sshd_config

Find the string which defines the port and edit it:

# What ports, IPs and protocols we listen for

Port 22

Now restart sshd service

service sshd restart

Make sure you have a new ssh port opened in your firewall.

Was this answer helpful?

 Print this Article

Also Read

Dovecot /postfix with Roundcube WebUI

Following guide was tested on CentOS 6. Install epel repository: wget...

Disabling selinux

Selinux annoying you? Get it out! How to disable selinux Open its config file nano...


 First of all make sure you have the ports 20-21 opened in your firewall. If not, you...

Security tips for Linux server

1. Use only  strong passwords for all accounts , especially for root. Always use a secure root...

Generating public/private ssh keys

How to generate and use public / private ssh keys This guide is tested on Centos 6 To...