Centos 6 : To change port ssh

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


/etc/init.d/sshd restart exit

connect : ssh -p7777

The Result / Impact : i cant connect to my server in the DO cloud :(. Below the log:

  1. Connect via Failed to establish a connection to the console. Please reload.

2.Connect mac console my_mac>$ ssh -p7777 ssh: connect to host port 7777: Operation timed out

Note : my iptables still default from DO image, and i’m not yet configure :)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Oo, i made mistake :( <br>the mistake is using the ip private O). <br> <br>------------------------ <br>Public Network <br>IP Address: <br> <br>Private Network: <br>Private IP: <br>------------------------------------- <br> <br>The solution is: <br>my_mac>$ ssh -p7777 <br> <br>thanks to Ryan

oh , miss typo : <br>at the point : <br>my_mac>$ ssh -p7777 <br> <br>i mean : <br>my_mac>$ ssh -p7777 <br>my_mac>$ ssh -p7777 <br>my_mac>$ ssh <br> <br>still cannot access.