Estoy intentando SFTP con Filezilla pero no puede conectarse al servidor y creo que esto se debe a las reglas de mi firewall.
Puedo SSH absolutamente bien. El puerto para SSH es 6128. ¿Alguien puede decirme qué cambios tendría que hacer para permitir una conexión FTP a través de SSH dado que SSH ya está funcionando?
(Aquí están mis reglas de IPtables)
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             loopback/8           reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             udp dpt:9987
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:10011
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:30033
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:6128
ACCEPT     icmp --  anywhere             anywhere             icmp echo-request
LOG        all  --  anywhere             anywhere             limit: avg 5/min burst 5 LOG level debug prefix "iptables denied: "
DROP       all  --  anywhere             anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
Chain fail2ban-ssh (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

sftpherramienta de línea de comandos en el servidor para conectarse, lo que es útil para verificar las cosas antes de incorporar Filezilla a la mezcla. digitalocean.com/community/tutorials/… .Respuestas:
Para acceder a su sftp desde otros hosts, asegúrese de que lo siguiente esté instalado y configurado correctamente.
Agregó su clave pública a ~ / .ssh / Authorizedkeke
Inicie el servidor ssh con el puerto 22 / TCP abierto
# /etc/init.d/sshd start# iptables -I INPUT -j ACCEPT -p tcp --dport 22Finalmente prueba
$ sftp <login>@<hostname>fuente
Subsystem sftp internal-sftpLo hice por mí. Se configuró/usr/libexec/openssh/sftp-serverde manera predeterminada, que ni siquiera existíaSubsystem sftp internal-sftpa sshd_config también funcionó para mí sin otros cambios en Centos.En mi caso, el usuario tenía
zshen la parte superior de su archivo .bashrc, para que pudiera caer en el shell zsh en lugar de bash.bash era su caparazón predeterminado. Eliminar esto resolvió el problema. Entonces,
chsh user -s /bin/zshpara que el usuario conserve zsh como su shell predeterminado.fuente
fish).¿Tiene algún texto que vaya a la consola (por ejemplo, declaraciones de eco) en alguno de sus archivos .profile como
.bashrc? Esto puede interferir con la conectividad sftp. Vea mi respuesta a una pregunta similar en serverfaultfuente
fishesta, se producirán problemas similares.Su software antivirus también puede causar esto. Lo enfrentamos recientemente.
sshvia PuTTY funcionaba bien, pero WinSCP no pudo conectarse. Comenzó a funcionar una vez que se configuró una excepción en el antivirus.fuente
Si está utilizando filezilla, la siguiente respuesta me ayudó:
https://www.digitalocean.com/community/questions/able-to-access-via-ssh-but-not-filezilla
fuente