Sunday, November 17, 2019

Fedora 30 Add another port for ssh'ing to get around some wifi filters

Some ISP's that offer free wifi will not allow you to ssh. To get around this you can set your ssh server to use another port like 8080.

For Fedora 30

1) sudo vim /etc/ssh/sshd_config

Change

#Port 22
to
Port 22
Port 8080


# This allows two ports to connect to ssh

2) Update selinux to allow ssh on port 8080

sudo semanage port -m -t ssh_port_t -p tcp 8080

If you use -a you will get an error like
ValueError: Port tcp/8080 already defined

If you -d you will get another error like
ValueError: Port tcp/8080 is defined in policy, cannot be deleted

Use this to check:

sudo semanage port -l | grep 8080
http_cache_port_t              tcp      8080, 8118, 8123, 10001-10010
ssh_port_t                     tcp      8080, 22