Can't connect via sftp from windows 10 to ubuntu 18.04 dir(all in LAN) - sftp works internal on server

-1

1

ANSWER: ufw allow 22/tcp I'm setting new server(ubuntu server 18.04) for small browser app and I was trying to establish sftp to my windows 10. I used this tutorial:https://www.digitalocean.com/community/tutorials/how-to-enable-sftp-without-shell-access-on-ubuntu-18-04#prerequisites

I succesfully execute sftp ricardo@192.168.10.5 so it works on server. Chroot also works. I can ping my win 10 form server and viceversa, also i see my app on LAN. example: http://192.168.10.5/info.php. Also i can ping particular port using nmap

nmap:

Nmap scan report for 192.168.10.5
Host is up (0.00s latency).
PORT   STATE    SERVICE
22/tcp filtered ssh
(for port 20) 20/tcp filtered ftp-data
MAC Address: 00:xx:xx:xx:xx:xx (VMware)
Nmap done: 1 IP address (1 host up) scanned in 12.15 seconds

my_sshd_config:

Match User ricardo 
ForceCommand internal-sftp 
PasswordAuthentication yes 
ChrootDirectory /var/www 
PermitTunnel no 
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

from filezilla i get:

Status: (...)
Status: (...) 192.168.10.5:20...
response    fzSftp started, protocol_version=8
command:    open "ricardo@192.168.10.5" 20
error:  (...)
error:  (...)

simmilar error on Cyberduck(where I seted exact dir to: var/www) "Connection timed out: connect. The connection attempt was rejected. The server may be down, or your network may not be properly configured"

galli

Posted 2019-06-19T06:10:02.870

Reputation: 5

You are right i added more data. – galli – 2019-06-19T06:23:30.713

Is your SFTP server on Digital Ocean? Or is it a local network server? + Why are you using port 20? – Martin Prikryl – 2019-06-19T06:44:13.843

No, all is in LAN and i used port 20 becouse i had no idea why port 22 isn't working – galli – 2019-06-19T06:52:04.363

So is your SSH/SFTP server running on port 20? If sftp ricardo@192.168.10.5 works, then it's not running on port 20. So do not show us irrelevant logs. Show us logs for port 22. – Martin Prikryl – 2019-06-19T06:52:38.327

I think it's not. In ufw i have this ports as i think open( 80,443/tcp for apache) and (22/tcp for OpenSSH). I wonder why i get this nmap 20/tcp filtered ftp-data form this command >nmap -p 20 192.168.10.5(full log above) – galli – 2019-06-19T06:55:41.770

maybe this is a problem [link]http://prntscr.com/o3q570

– galli – 2019-06-19T07:17:07.290

Answers

0

your filezilla log showing 192.168.10.5:20, try changing your filezilla profile to SFTP and try again.

Sithter

Posted 2019-06-19T06:10:02.870

Reputation: 31

port 22(I have this port open in ufw for OpenSSH 22/tcp) gives same error as port 20. I picked protocol SFTP so i think filezilla is on SFTP profile. – galli – 2019-06-19T06:50:00.090

port 22 in the server is working fine if you are able to sftp to it. I think you should check your filezilla profile if you are using port 22 and not port 20/21. – Sithter – 2019-06-19T06:57:19.097

same for 22 as it was for 20 ofc i try to sftp://x.x.x.x error Status: (...) Status: (...) 192.168.10.5:20... response fzSftp started, protocol_version=8 command: open "ricardo@192.168.10.5" 22 error: (...) error: (...) – galli – 2019-06-19T06:59:27.393

it's still showing port 20, can you type 22 in the Port box. It should be like this

Status: Connecting to 172.1.1.109... Response: fzSftp started, protocol_version=8 Command: open "sftponly@172.1.1.109" 22 Command: Pass: ****** Status: Connected to 172.1.1.109 Status: Retrieving directory listing... Command: pwd Response: Current directory is: "/" Status: Directory listing of "/" successful – Sithter – 2019-06-19T07:31:00.000

http://prntscr.com/o3qil5 – galli – 2019-06-19T07:34:49.023

at this point i'm assuming you are able to sftp with command from your local machine (where your filezilla installed). try setting the timeout value to 60 seconds, Edit > Settings > Connection – Sithter – 2019-06-19T07:44:11.117

ty for help but I had port 22 blocked somehow - no kappa – galli – 2019-06-19T08:13:50.177

well, at least it's working now – Sithter – 2019-06-19T08:26:04.537