Centos 6 : To change port ssh

April 6, 2014 1.5k views
Hi all, I want to share and need suggestion , what i have done to my cloud server at DO. My Objective : to change the default port ssh form 22 to 7777 Task ( below is what i have done ) ------------------------------------ #--1 ADD and CONFIGURE USER useradd iloveyou groupadd weloveyou ... vi /etc/ssh/sshd_config #--2 Modification part Port 7777 ClientAliveInterval 900 ClientAliveCountMax 0 ChallengeResponseAuthentication yes GSSAPIAuthentication no PermitRootLogin no AllowUsers iloveyou PermitEmptyPasswords no # --FINISH /etc/init.d/sshd restart exit connect : ssh iloveyou@10.129.xxx.xx -p7777 The Result / Impact : i cant connect to my server in the DO cloud :(. Below the log: ---------------- 1. Connect via https://cloud.digitalocean.com/droplet/console/ Failed to establish a connection to the console. Please reload. 2.Connect mac console my_mac>$ ssh webmaster@10.129.xxx.xx -p7777 ssh: connect to host 10.129.xxx.xx port 7777: Operation timed out Note : my iptables still default from DO image, and i'm not yet configure :) thx
2 Answers
oh , miss typo :
at the point :
my_mac>$ ssh webmaster@10.129.xxx.xx -p7777

i mean :
my_mac>$ ssh iloveyou@10.129.xxx.xx -p7777
my_mac>$ ssh root@10.129.xxx.xx -p7777
my_mac>$ ssh root@10.129.xxx.xx

still cannot access.
Oo, i made mistake :(
the mistake is using the ip private O).

Public Network
IP Address: 188.xxx.xxx.xx

Private Network:
Private IP: 10.xxx.xxx.xx

The solution is:
my_mac>$ ssh iloveyou@188.xxx.xxx.xx -p7777

thanks to Ryan
Have another answer? Share your knowledge.