Whenever deploying an Ubuntu server, accessing and managing it with SSH via LAN (Local Area Network) was never an issues.
But if you wanted to allow SSH access remotely or through Internet, then the standard port must be changed and the server must be protected behind a firewall.
1) To check existing SSH port :-
2) To change the SSH port :-
Search for line --> #Port 22
Add a new line just below it with your preferred new SSH port --> Port [Your New SSH Port Number]
(eg. Port 9222)
3) Restart the SSH service :-
4) Also you might want to check UFW (if enabled) to have the specific port enabled :-
5) If the new port was not in the list, run the following command to ALLOW the access :-
6) Now you will need to DENY the access of common SSH port number 22 :-
7) Now you can test the connection of the new port and the old port to confirm the connection is properly configured. Also ensure the firewall also allows the newly created port pass-thru.
!!! HAPPY COMPUTING !!!
No comments:
Post a Comment