3. change the port in the file /etc/ssh/sshd_config and make following changes firstly unhash the port entry & change the port number to 2222:
vi /etc/ssh/sshd_config Port 2222 --------------------------------------- [root@kalwa1 ~]# cat /etc/ssh/sshd_config|grep -i port Port 2222
4. Now restart the sshd service to take affect the changes we made in the ssh configuration in the above steps.
[root@kalwa1 ~]# service sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ] [root@kalwa1 ~]#
5. Now if you try to connect with default port it won’t connect. System gives connection refused error as below:
[root@kalwa1 ~]# ssh manmohan@192.168.216.130 ssh: connect to host 192.168.216.130 port 22: Connection refused [root@kalwa1 ~]#
Leave a Reply