Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It is not either-or, you can make sshd listen on two ports.
What you cannot do is make a dynamic change, you have to bounce or refresh sshd to have it pick up configuration changes. Did you?
It is not either-or, you can make sshd listen on two ports.
What you cannot do is make a dynamic change, you have to bounce or refresh sshd to have it pick up configuration changes. Did you?
i login to server with port 22.
and then change /etc/ssh/sshd_config ,set Port to 5050
and /etc/init.d/sshd restart
Don't need to. Just 'semanage port -a -t ssh_port_t -p tcp 5050' to add port TCP/5050.
Don't need to. Just 'iptables -A INPUT -i eth0 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT'.
BTW you didn't post actual output of 'ssh -v -v -v servername -p 5050' nor answer wpeckham's question abotu restarting sshd...
thanks.
i had try what you said. but it doestn't work. so i stop them rudely.
i had restart sshd.
and the output of ssh -vv servername -p 5050 is:
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011
debug1: Reading configuration data /home/tgf6/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to zhuanfa [223.*.*.*] port 5050.
and i found out that if the server listen on not well-known port like 8080,5000
the client cannot connect to .
so is it the iptables problem?
Likely well-meant but unfortunately "doesn't work" doesn't contain the kind of technical details I can do anything with.
Quote:
Originally Posted by tgf2
so is it the iptables problem?
Don't know. Could do with more nfo to start with.
On the client run:
- connectivity: 'hping2 -n -V -I eth0 --scan 22,5050 -S servername'
- firewall: 'for TABLE in $(</proc/net/ip_tables_names); do /sbin/iptables -t $TABLE -n -L; done;'.
Now on the server run:
- just to make sure: 'service sshd restart'
- 'for TABLE in $(</proc/net/ip_tables_names); do /sbin/iptables -t $TABLE -n -L; done;'
- ports opened by SSH daemon: 'lsof -Pwlnp `pgrep sshd` -a -i;'
- tcp_wrappers: 'grep -v ^# /etc/hosts.*|grep .;'
- 'grep -v ^# /etc/ssh/sshd_config|grep .;'
- enabled?: 'selinuxenabled; echo $?;'
- port assignments?: 'seinfo -p|grep ssh;'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.