Change the SSH port

Changing the port sshd listens on is a simple process; it’s just a matter of updating your sshd_config file and then reloading the new configuration.
Use the procedure below to change the port that sshd is listening on to 2995:

Warning: Incorrectly following this procedure may render your server unreachable through SSH. If by following this procedure you are locked out of your server, and you require Spry Support to reset SSHD, you may incur a support fee for resetting SSH on your server.

1. From your terminal session, edit /etc/ssh/sshd_config


Code:

bash-2.05b# vi /etc/ssh/sshd_config

2. Look for the following line:


Code:

#Port 22

3. Change the line so it looks like this:


Code:

Port 2995

4. Save and close the file

5. Load the new configuration by using the RedHat service command


Code:

bash-2.05b# service sshd reload

Note: you may immediately lose connectivity to your server on the open ssh session you are currently running.

6. Test the connection


Code:

(tres@Ishmael)(~/Desktop) $ ssh username@myhostnaname.com -p 2995

Take note of the -p 2995 flag used when connecting to the server. If you are using OS X or a Linux desktop system like Mandriva or Ubuntu, you’ll need to specify the port number when connecting. If you’re using PuTTy on Windows, you can specify the port number in the profile for you connection and then re-save the profile using the new port.

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

%d bloggers like this: