Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-28-2010, 09:51 AM   #1
Registered: Dec 2009
Posts: 200

Rep: Reputation: 15
ssh port not working

dear gurus

i have centos 5.4

i change port in /etc/ssh/ssh_config and restart sshd service

when i try to access, the new port not working and old port still responding from windows pc. then suddenly i found port 22 and new port stop responding no more.i use putty or securecrt from my window pc. then i connect 1 more linux box from there i do <ssh> i found it is still using port 22

i am not using any firewall or route nothing block it is testing on network.

then also i were using scp jobs in crontab that stop working.

highly appreciate in advanced

kind regards
Old 03-28-2010, 10:01 AM   #2
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
You should change port in /etc/ssh/sshd_config
/etc/ssh/ssh_config is ssh client for
Old 03-28-2010, 10:02 AM   #3
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
try editing /etc/ssh/sshd_config
the clue was when you edited /etc/ssh/ssh_config and then restarted sshd service.
Old 03-29-2010, 06:37 AM   #4
Registered: Dec 2009
Posts: 200

Original Poster
Rep: Reputation: 15
i change the port to 9999, and restart sshd and network service it does not work. the changing port has no effect on machine. it still connect ssh with port 22, what else could be missing, no firewall or selinux security in between i am testing overlan.

ssh -p 9999
ssh: connect to host port 9999: Connection refused
[root@zamanda ~]# ssh -p
Bad port ''
[root@zamanda ~]# ssh -p 22
The authenticity of host ' (' can't be established.
RSA key fingerprint is 10:db:59:df:20:86:cc:05:2c:c7:8f:8f:6e:73:5d:78.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Old 04-05-2010, 01:15 AM   #5
Registered: Dec 2007
Posts: 54

Rep: Reputation: 16

Hi There,

I'm using centos as well in order for your ssh to work you must open the port in your local fire wall by typing the following:

from the command line type:


go to firewall configuration

go to customize

under port add your port number

P.S like the other said make sure you do all your ssh configuration in:



Old 04-05-2010, 01:18 AM   #6
Registered: Dec 2007
Posts: 54

Rep: Reputation: 16


BTW you must add the info I told you even if your firewall is disable.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh port forwarding not working tommiy Linux - Networking 1 04-22-2007 08:33 AM
port knocking only for ssh port? xpucto Linux - Security 1 03-29-2007 08:22 AM
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 06:09 AM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
New firewall: ssh on port 80 not working anymore... norbi99 Linux - Security 4 10-09-2004 09:14 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:03 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration