LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-29-2021, 05:35 PM   #1
groovepunk
LQ Newbie
 
Registered: Apr 2021
Posts: 4

Rep: Reputation: Disabled
How do I connect from FTP client on my phone to localhost ftp server?


Hi all,

so I have installed vsftpd on my Debian Buster system, now I want to check my IP address and it gives the following: XXX.X.X.1/8. I believe this refers to localhost IP address on my computer.

No I want to connect from Android phone using AndFTP application, but when you add Hostname as your local IP address as describer above, it fails.

I am using standart Virgin Media Hub 3.0 here in UK, but the question is can I even connect through this hub to my localhost PC with anFTP application or do I have to provide an IP address of the router itself?

Is it even possible and how do I get that hubs IP address whilst using Linux terminal?

Thank you
 
Old 04-29-2021, 05:58 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
1. You should be using sftp and not ftp especially over the internet. andFTP supports sftp protocol which is ssh.

2. If you want to connect to your PC over the internet you need to forward ssh port in the hub.

3. There are many ways to find your public IP address. Just Google it.

4. There are free dynamic DNS sites so you can have the same URL regardless if your public IP address changes.
 
Old 04-30-2021, 01:22 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
I second the recommendation to drop FTP and stay with SFTP. For that, uninstall vsftpd and install openssh-server. Then you will have SFTP support on your server and can then adjust it to work with keys.

Then once you can log in from Android using SFTP with keys over the LAN, forward port 22 on your router (or another external port) to your server's port 22.

Some reasons to stay with SFTP is that SFTP is very easy to set up and requires only one port be opened and forwarded from your router. FTP, on the other hand, requires various random per-connection ports to be opened. Even experienced system and network adminstrators find FTP difficult. So, if you're stuck at this stage with FTP, please cut your losses and upgrade to SFTP. You'll save many hours of wasted effort as well as prevent your system from becoming a pushover for attacks.
 
Old 05-02-2021, 07:44 PM   #4
groovepunk
LQ Newbie
 
Registered: Apr 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
Additional questions

Wow, easier than I thought (still beginner though), thank you guys.

Now, I have installed sshd server thanks to manual, however:

1) So I cd to /etc/ssh/ and then edit sshd_config and add "Port 2222", so It wont block any existing ports.

And then check the existing ports with netstat -tulpn, so I can seee Active Internet Connections, but all I see is port 22 within tcp and tcp6.

Why I do not see the port 222 based on changes in sshd config?

Should the newly set port be active even if I changed "ListenAddress" value to my current instead of default?

2) I will try to connect using: ssh -p 2222 username@ip

And It returns Connection Refused..

And even if I restart sshd I can still see active port 22, but not 2222

What am I doing wrong and how to establish new ports connection?

Thank you all,

Ondrej
 
Old 05-02-2021, 08:43 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
my IP address and it gives the following: XXX.X.X.1/8. I believe this refers to localhost IP address on my computer.
Every PC with tcp/ip networking has a localhost virtual network adapter with the same IP address i.e IPv4 127.0.0.1 or IPv6 ::1. No need for obfuscation. This allows networking applications to connect to clients on the same computer regardless of an active physical network.

Quote:
Should the newly set port be active even if I changed "ListenAddress" value to my current instead of default?
What address did you use for the ListenAddress?

The first step is to check to see if ssh works on the computer itself. ssh -p 2222 username@localhost

If that works you can try connecting from your phone using the systems LAN address. If you look at the output of the ip a command you will see something like
2. enp0s25: ...
...
inet xxx.xxx.xxx.xxx

That inet address is your LAN IP address. Assuming your phone is connected to your LAN use ssh -p 2222 username@xxx.xxx.xxx.xxx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ProFTPd ... FTP client fails to connect: timeout after client sends 'LIST' nutnut Linux - Software 2 01-01-2006 07:09 PM
localhost@localhost FXRS Red Hat 6 10-09-2003 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration