Ask Your Question
1

Enable SSH port other than 22

asked 2014-02-06 04:57:24 -0600

Zaal gravatar image

I'm trying to connect to my home desktop from work. My current situation is (on Fedora 20):

1- I am able to connect to my desktop from work using the default port (22).

2- When I setup an alternative port (say 11234) and adjust SELinux and the router port forwarding, I'm able to connect to my desktop only if I flush iptables (iptables -F). Otherwise I would get "no route to host" message.

From what I understand, iptables act as a firewall. So I went to Firewall Setting and tried to either open port 11234 or change SSH port to 11234, but they didn't fix the problem. I still need to flush all the rules.

Any suggestion on how to fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-02-06 05:09:39 -0600

NickTux gravatar image

If this is a firewall problem, try to open the port permanently.

sudo firewall-config

and be aware of the Runtime configuration. Change this to Permanent before you make and save any changes or they'll be lost in next reboot. (or service restart).

Relevant pictures for Firewall configuration can be found in this answer.

edit flag offensive delete link more

Comments

1

Thanks! Using permanent option fixed the problem.

Zaal gravatar imageZaal ( 2014-02-06 05:53:27 -0600 )edit
1

don't forget to adjust your SELinux configuration to reflect the changes:

# semanage port -a -t ssh_port_t -p tcp 8991
ILMostro gravatar imageILMostro ( 2014-02-06 19:34:32 -0600 )edit

Question Tools

Stats

Asked: 2014-02-06 04:57:24 -0600

Seen: 5,154 times

Last updated: Feb 06 '14