SSH on non-standard port?


#1

Hello I’ve added a non-standard port to the ssh_config of my easy engine machine yet it’s still not allowing me to SSH into that port. I’m wondering if EasyEngine does something else to the machine that would block access to a non-standard port that I need to change. Thanks!


#2

Check your firewall. It’s probably blocking that port.

EDIT: If you’re using Ubuntu, your Firewall is probably UFW. Then do this:

sudo ufw status

To check if UFW is running, if it is then open the port like this:

sudo ufw allow 2222/tcp

Obviously, replace 2222 with your SSH port.


#3

Running sudo ufw status results in “inactive”


#4

Did you restart SSH after changing ports?

sudo restart ssh


#5

I did


#6

run

netstat -atun

and look for a line like this:

tcp 0 0 0.0.0.0:5022 0.0.0.0:* LISTEN

where 5022 would be your chosen SSH port. this is to check if the port is actually open

EDIT:

also run:

iptables -L

and check if your port is open


#7

I get “command not found” when running netstat-atun


#8

also command not found for iptables-l


#9

sorry iptables does work but I had to use sudo and I get

Chain INPUT (policy ACCEPT) target prot opt source destination

Chain FORWARD (policy ACCEPT) target prot opt source destination

Chain OUTPUT (policy ACCEPT) target prot opt source destination


#10

Here’s a screenshot http://d.pr/i/1bYAc


#11

sorry realized the -atun was a flag. here’s the screenshot of that http://d.pr/i/Lf3J


#12

Ok I was able to add it and netstat -atun shows it correctly listening but I’m still getting denied


#13

It look longer than I care to admit but it turns out I edited the ssh_config and not the sshd_config. It turns out if you edit the wrong config file it doesn’t seem to work:)

Thanks for the help. really appreciate it. I ended up learning a lot so that’s a bonus.


#14

Hi,

I’m glad it worked, that would be my next step of troubleshooting (should have been the first though lol). Learning is always a plus.


#15