BlowingRaspberries
Posts: 19
Joined: Thu Apr 12, 2012 9:48 am

Configuring FTP?

Thu Jun 07, 2012 1:53 pm

How do I configure FTP so I can upload files from my Mac?

I have OpenSSH server installed but so far can't access the Pi via FTP - connection refused.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Configuring FTP?

Thu Jun 07, 2012 1:55 pm

Does it need to be FTP? Are you familiar with SSH's equivalent (and better) file copying commands?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

jmacey
Posts: 135
Joined: Thu May 31, 2012 1:05 pm

Re: Configuring FTP?

Thu Jun 07, 2012 1:59 pm

If OpenSSH is installed you could try sftp or even scp

I usually use scp to copy files to and from the pi (and if you setup with no password this is even easier)

Another thing I do is use rsync on the mac to keep a fresh copy of the pi home directory on my mac for safety. I have a directory called fromPI on my mac and I run

rsync -avz --delete -e ssh jmacey@pi:/home/jmacey ./

where pi:/home/jmacey is my pi home dir and it works.

If you edit /etc/hosts on your mac and put in the ip address of the pi you will not have to type in the name of it each time. In my example it's

192.168.0.13 pi

but if you type ifconfig on your pi you can get your own ip

hope this helps

Jon

jmacey
Posts: 135
Joined: Thu May 31, 2012 1:05 pm

Re: Configuring FTP?

Thu Jun 07, 2012 2:07 pm

btw I don't think ssh or ftp servers are on by default (and ftp isn't installed by default)

you may have to log into the pi and do the following
apt-get install ftp ftpd


for sftp (preferred) do the following
cd /etc
sudo su
./ssh restart

If you want it to boot by default

update-rc.d ssh defaults

BlowingRaspberries
Posts: 19
Joined: Thu Apr 12, 2012 9:48 am

Re: Configuring FTP?

Thu Jun 07, 2012 2:14 pm

jmacey wrote:If OpenSSH is installed you could try sftp or even scp

I usually use scp to copy files to and from the pi (and if you setup with no password this is even easier)
Ahh, thanks. Connecting with sftp I now get to see my directory structure, so nearly there! However, it doesn't allow me to actually upload any files.

I'm assuming I need to do something with sshd_config but I'm scratching my head.

BlowingRaspberries
Posts: 19
Joined: Thu Apr 12, 2012 9:48 am

Re: Configuring FTP?

Thu Jun 07, 2012 2:27 pm

Okay, I can now add files to directories within my Home directory but I'm looking to put files in /var/www - this is denied. How can I give myself permissions to FTp to this?

BlowingRaspberries
Posts: 19
Joined: Thu Apr 12, 2012 9:48 am

Re: Configuring FTP?

Thu Jun 07, 2012 2:36 pm

Ahh, panic over, don't think I'd got around to doing 'sudo chown [MY USERNAME] /var/www' but thought I had.

This has fixed it.

mremmers
Posts: 3
Joined: Sat Jun 23, 2012 1:46 am

Re: Configuring FTP?

Mon Jun 25, 2012 4:58 am

I also wanted to set-up old-school FTPD of my R-Pi.
(I know it is not secure)
I installed the FTP and FTPD as you showed using:
apt-get install ftp ftpd

That worked fine.

I am able to use the FTP client normally.
But the FTPD is not listening on port 21
Do I need to enable it somewhere?

Thanks for any help.

mremmers
Posts: 3
Joined: Sat Jun 23, 2012 1:46 am

Re: Configuring FTP?

Tue Jun 26, 2012 2:31 pm

mremmers wrote:I also wanted to set-up old-school FTPD of my R-Pi.
(I know it is not secure)
I installed the FTP and FTPD as you showed using:
apt-get install ftp ftpd

That worked fine.

I am able to use the FTP client normally.
But the FTPD is not listening on port 21
Do I need to enable it somewhere?

Thanks for any help.
BTW - I found the solution. The install placed an example config file in /usr/share/doc/ftpd/examples/ftpd.xinetd
I copied that file to the etc/xinetd.d directory, and renamed it ftpd
Then I edited it and changed IPv6 to IPv4

Return to “Beginners”