WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: OpenSSH as FTP server?  (Read 3890 times)

Offline loppanjo

  • Newbie
  • *
  • Posts: 18
OpenSSH as FTP server?
« on: April 12, 2016, 01:30:19 PM »
I've been trying to get ´VSFTPD´ to work but removed it as I couldn't get an SFTP connection.
Recently I read that OpenSSH can be used to SFTP in to the server so I tested to connect with
FileZilla and noticed that the FTP server is already up and running.
Now to the super question. (As i'm a noob and can't see which services are running. Thought it would be service/services but nun worked)

Is the FTP server which is running from boot OpenSSH or another FTP I found in ´/init.d/services´ called ´tftpd´?
And how do u see the freaking currently running services?!?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: OpenSSH as FTP server?
« Reply #1 on: April 12, 2016, 02:17:36 PM »
To see what's listening try 'netstat -a'. Do you need an interactive connection? If you just need to transfer some files could you use SCP? It has a recursive option.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: OpenSSH as FTP server?
« Reply #2 on: April 12, 2016, 02:22:15 PM »
On piCore-7.x SCP works out of box, you can connect from other machine and move, rename, copy, delete, etc. files similar to ftp using many different clients, like WinSCP on WINDOWS, mc (Midnight Commander) or scp on Linux.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: OpenSSH as FTP server?
« Reply #3 on: April 12, 2016, 02:26:41 PM »
Is the FTP server which is running from boot OpenSSH or another FTP I found in ´/init.d/services´ called ´tftpd´?

There are no FTP server running by default and it is not included in the base nor in default SD-card image.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline loppanjo

  • Newbie
  • *
  • Posts: 18
Re: OpenSSH as FTP server?
« Reply #4 on: April 12, 2016, 02:30:47 PM »
Is the FTP server which is running from boot OpenSSH or another FTP I found in ´/init.d/services´ called ´tftpd´?

There are no FTP server running by default and it is not included in the base nor in default SD-card image.
Strange because if I make a fresh install of latest piCore and try connecting with FileZilla to
sftp://192.168.1.2 with default username and password I gain access to all files. Is that possible without a FTP server running?

This is my output from ´netstat -a´. Still can't figure out what is listening on what?
Code: [Select]
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0    320 192.168.1.2:ssh         192.168.1.5:65102       ESTABLISHED
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     SEQPACKET  LISTENING       1213 /run/udev/control
unix  3      [ ]         DGRAM                      7221
unix  3      [ ]         DGRAM                      7222

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: OpenSSH as FTP server?
« Reply #5 on: April 12, 2016, 02:37:03 PM »
FTP and SCP are two different kind of animals. You are asking for FTP but talking about SCP.

1) There are no FTP server running (port 21)
2) There is SCP available, provided by OpenSSH (port 22)

Check with a port scanner like nmap which ports are opened.

Why do you need FTP if SCP works with FileZilla?
« Last Edit: April 12, 2016, 02:40:40 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline loppanjo

  • Newbie
  • *
  • Posts: 18
Re: OpenSSH as FTP server?
« Reply #6 on: April 12, 2016, 02:43:53 PM »
OH... Thought I connected via FTP xD
But is SCP(never heard/read of it) a secure option? I mean more secure than FTP (like SFTP)?
Will SCP use the same configs as SSH? (Authentication, allowed users and so on)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: OpenSSH as FTP server?
« Reply #7 on: April 12, 2016, 02:47:28 PM »
SFTP is not FTP.  It uses SSH as the underlying protocol.
See the stock sshd_config file.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: OpenSSH as FTP server?
« Reply #8 on: April 12, 2016, 02:48:40 PM »
SCP (Secure CP) is as secure as your SSH connection based on the fact it is using an SSH link.

Read it, may help:

http://superuser.com/questions/134901/whats-the-difference-between-scp-and-sftp

http://superuser.com/questions/218126/do-all-servers-equipped-with-sftp-have-scp?rq=1



« Last Edit: April 12, 2016, 02:54:42 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: OpenSSH as FTP server?
« Reply #9 on: April 12, 2016, 03:08:32 PM »
My advice is to forget ftp, leave piCore OpenSSH as it is and use an scp/sftp client up to your choice.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline loppanjo

  • Newbie
  • *
  • Posts: 18
Re: OpenSSH as FTP server?
« Reply #10 on: April 12, 2016, 03:22:42 PM »
My advice is to forget ftp, leave piCore OpenSSH as it is and use an scp/sftp client up to your choice.
Will do that now that I know about SCP.
All I wanted was a secure way to control my server commands/files.
Thank you for all answers and fast responses :D

Maybe one last thing
'ssh_config' is used when using ssh from my pi to another server and
'sshd_config' is used when I connect from my personal desktop to my pi right? (Think it worked like that but wanna be sure)
« Last Edit: April 12, 2016, 03:33:30 PM by loppanjo »

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: OpenSSH as FTP server?
« Reply #11 on: April 12, 2016, 08:45:53 PM »
I use Superputty on my Windows box or just a terminal window in Linux.

run ssh tc@x.x.x.x
login with password

Superputty allows this in one operation.
May have to say "yes" for the ssh key or delete it...

run sudo mc to edit files etc

For dumping a bunch of files I use Filezilla which will run on Windows/Linux/Raspbian.