Estou tentando fazer o SFTP com o Filezilla, mas ele não consegue se conectar ao servidor e acho que isso se deve às minhas regras de firewall?
Eu posso SSH absolutamente bem. A porta para SSH é 6128. Alguém pode me dizer quais alterações eu precisaria fazer para permitir uma conexão FTP por SSH, já que o SSH já está funcionando?
(Aqui estão as minhas regras do 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
sftp
ferramenta de linha de comando no servidor para conectar-se, o que é útil para verificar as coisas antes de colocar o Filezilla na mistura. digitalocean.com/community/tutorials/… .Respostas:
Para acessar seu sftp de outros hosts, verifique se o seguinte está instalado e configurado corretamente.
Sua chave pública foi adicionada a ~ / .ssh / allowed_keys
Inicie o servidor ssh com a porta 22 / TCP aberta
# /etc/init.d/sshd start
# iptables -I INPUT -j ACCEPT -p tcp --dport 22
Finalmente, teste
$ sftp <login>@<hostname>
fonte
Subsystem sftp internal-sftp
fez isso por mim. Foi definido como/usr/libexec/openssh/sftp-server
por padrão, que nem sequer existiaSubsystem sftp internal-sftp
ao sshd_config também funcionou para mim sem outras alterações no Centos.No meu caso, o usuário estava
zsh
no topo de seu arquivo .bashrc, para que ele pudesse cair no shell zsh em vez de no bash.bash era sua concha padrão. A remoção disso resolveu o problema. Eu, então,
chsh user -s /bin/zsh
para o usuário manter o zsh como seu shell padrão.fonte
fish
).Você tem algum texto acessando o console (por exemplo, instruções echo) em qualquer um dos seus arquivos .profile, como
.bashrc
? Isso pode prejudicar a conectividade sftp. Veja minha resposta para uma pergunta semelhante em serverfaultfonte
fish
esse, isso resultará em problemas semelhantes.Seu software antivírus também pode causar isso. Enfrentamos isso recentemente.
ssh
via PuTTY estava funcionando bem, mas o WinSCP não conseguiu se conectar. Começou a trabalhar depois que uma exceção foi configurada no Antivírus.fonte
Se você estiver usando o filezilla, a seguinte resposta me ajudou:
https://www.digitalocean.com/community/questions/able-to-access-via-ssh-but-not-filezilla
fonte