Crouton: Running ftp server in crouton

Created on 20 Oct 2015  路  6Comments  路  Source: dnschneid/crouton

Hi, Loving your work so far!! Such a wonderful piece of hack. I'm pretty new to bash scripting, so please bear with me if I can't quite get something right.

I'm trying to run an ftp server on chromebook. Apparently it is not as simple as sudo apt-get install vsftpd. When I run sudo service vsftpd status it returns vsftpd: unrecognized service, and ftp doesn't run at startup either. I got the ssh server up and running thanks to the wiki, so i figured i should put something in rc.local for ftp to work too. But I don't know how to do it (last time I did it, I screwed up my crouton installation so hard i had to restore it from a tar ball).

I'm running pretty standard xfce on intel chromebook. Thanks for any help!

question

Most helpful comment

Alright, I have been able to figure out how to set up FTP server on crouton. Just post here if anyone has trouble setting up FTP server.

Just doing sudo apt-get install vsftpd won't be enough on crouton. Reading all the normal guides on the internet, I got stuck at the steps that tell me to restart ftp using sudo service vsftpd restart. Comparing to an ordinary ubuntu installation, you won't be able to control it that way on crouton, I don't really know why. There is also no such file vsftpd inside /etc/init.d/.

However there is a file /sbin/vsftpd, and that's the only way to get it running. To turn on the server, run sudo vsftpd & on terminal (the & is necessary because running sudo vsftpd alone will stop your terminal since it won't start in background. However you can configure it to start everytime you log into crouton below.

After installing through apt-get, open up /etc/rc.local and add the following lines:

/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT
mkdir -p -m0755 /var/run/ftp
# uncomment this next line if you want vsftpd to auto start
# everytime you log into crouton
# /usr/sbin/vsftpd &

And then open up /etc/vsftpd.conf and edit the line secure_chroot_dir=/var/run/ftp

And that's it, you are all set.

All 6 comments

If you haven't seen it yet, maybe this official Ubuntu documentation will help - vsftpd.

Alright, I have been able to figure out how to set up FTP server on crouton. Just post here if anyone has trouble setting up FTP server.

Just doing sudo apt-get install vsftpd won't be enough on crouton. Reading all the normal guides on the internet, I got stuck at the steps that tell me to restart ftp using sudo service vsftpd restart. Comparing to an ordinary ubuntu installation, you won't be able to control it that way on crouton, I don't really know why. There is also no such file vsftpd inside /etc/init.d/.

However there is a file /sbin/vsftpd, and that's the only way to get it running. To turn on the server, run sudo vsftpd & on terminal (the & is necessary because running sudo vsftpd alone will stop your terminal since it won't start in background. However you can configure it to start everytime you log into crouton below.

After installing through apt-get, open up /etc/rc.local and add the following lines:

/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT
mkdir -p -m0755 /var/run/ftp
# uncomment this next line if you want vsftpd to auto start
# everytime you log into crouton
# /usr/sbin/vsftpd &

And then open up /etc/vsftpd.conf and edit the line secure_chroot_dir=/var/run/ftp

And that's it, you are all set.

Thanks for reporting back with your findings!

@ferb96 on line 2 of /etc/rc.local why run vftpd shell chroot on ftp shell chroot why not run it on default /var/run/vftp ?

@ferb96 - Thanx for the feedback and procedure, this would make a _great_ wiki contribution.

I don't see any /sbin/vsftpd after installing with apt-get. I have an /etc/vsftpd.conf file, but can't find any start/stop scripts. Running Trusty with Crouton latest: version 1-20160518095657~master:fd37bb79.

UPDATE: nvm, it's actually in /usr/sbin/vsftpd.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harryprince picture harryprince  路  3Comments

kgingging picture kgingging  路  5Comments

jvschiavo picture jvschiavo  路  4Comments

BRFNGRNBWS picture BRFNGRNBWS  路  3Comments

El-t0ro picture El-t0ro  路  4Comments