Iptables – Unable to SFTP (but can SSH) – Using port other than 22


I followed the iptables here:


I replaced the standard Port 22 in sshd_config with Port 1234

Currently I'm able to SSH via Port 1234, but unable to SFTP using Filezilla; it keeps saying it failed to authenticate. I've verified that the password is correct.

Does anyone know why SFTP is not working?

Best Answer

If you can ssh but not sftp, the issue is very unlikely to be in your firewall, as both services normally run on TCP port 22 - both are subsystems of sshd. You should first look closely at your sshd config, to find out why the sftp subsystem isn't active.

Opening up inbound TCP port 1234 is unlikely to be too hard, but for that to do anything you're going to need to make sshd listen on that port for sftp purposes, and for that, you're going to first need to make it listen on port 22 for sftp purposes.

Related Topic