Sunday, 27 November 2011
Install ProFTP server for Galaxy
Its not wise to use user sudo apt-get install proftpd or proftpd-basic because there are no postgres modules in default package.but if you have GUI interface udo apt-get install gadmin-proftpd is important
chanaka@localhost:~# wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4a.tar.gz
chanaka@localhost:~# tar xfvz proftpd-1.3.4a.tar.gz
chanaka@localhost:~/proftpd-1.3.4a#
chanaka@localhost:~/proftpd-1.3.4a# ./configure --disable-auth-file --disable-ncurses \
--disable-ident --disable-shadow --enable-openssl \
--with-modules=mod_sql:mod_sql_postgres:mod_sql_passwd
chanaka@localhost:~/proftpd-1.3.4a# make
chanaka@localhost:~/proftpd-1.3.4a# make install
Then create PostgreSQL user called galaxyftp with least privileges.
chanaka@localhost:~$ createuser -SDR galaxyftp
chanaka@localhost:~$ psql galaxy_prod
psql (8.4.9)
Type "help" for help.
galaxy_prod=# ALTER ROLE galaxyftp PASSWORD '[password]';
ALTER ROLE
galaxy_prod=# GRANT SELECT ON galaxy_user TO galaxyftp;
GRANT
galaxy_prod=# \q
Here is the final proftd.conf (/usr/local/proftpd/proftpd.conf)
# Basics, some site-specific
ServerName "myserver.org"
ServerType standalone
DefaultServer on
Port 21
Umask 077
SyslogFacility DAEMON
SyslogLevel debug
MaxInstances 30
User nobody
Group nogroup
DisplayConnect /ftp/proftpd_welcome.txt
# Passive port range for the firewall
PassivePorts 30000 40000
# Cause every FTP user to be "jailed" (chrooted) into their home directory
DefaultRoot ~
# Automatically create home directory if it doesn't exist
CreateHome on dirmode 700
# Allow users to overwrite their files
AllowOverwrite on
# Allow users to resume interrupted uploads
AllowStoreRestart on
# Bar use of SITE CHMOD
<Limit SITE_CHMOD>
DenyAll
</Limit>
# Bar use of RETR (download) since this is not a public file drop
<Limit RETR>
DenyAll
</Limit>
# Do not authenticate against real (system) users
<IfModule mod_auth_pam.c>
AuthPAM off
</IfModule>
# Set up mod_sql_password - Galaxy passwords are stored as hex-encoded SHA1
SQLPasswordEngine on
SQLPasswordEncoding hex
# Set up mod_sql to authenticate against the Galaxy database
SQLEngine on
SQLBackend postgres
SQLConnectInfo galaxy_prod@myserver.org galaxyftp [password]
SQLAuthTypes SHA1
SQLAuthenticate users
# An empty directory in case chroot fails
SQLDefaultHomedir /ftp/proftpd
# Define a custom query for lookup that returns a passwd-like entry. UID and GID should match your Galaxy user.
SQLUserInfo custom:/LookupGalaxyUser
SQLNamedQuery LookupGalaxyUser SELECT "email,password,'512','512','/ftp/%U','/bin/bash' FROM galaxy_user WHERE email='%U'"
Note! Don't forget to configure pg_hba.conf entry for host "XXXXX", Also check the firewall for ftp usually 21,We need to use galaxy user like 512. Done!
We can see the errors by using following
chanaka@localhost:~# cd /usr/local/sbin
chanaka@localhost:~/usr/local/sbin# ./proftpd -nd9
or check PostgreSQL or proftpd log files
If you get "Fatal: unknown configuration directive 'AuthPAM' " error use following solution.
<IfModule mod_auth_pam.c>
AuthPAM off
</IfModule>
Also following lines may useful to you:(/usr/local/sbin)
chanaka@localhost:~#ps aux | grep proftpd
chanaka@localhost:~#Kill [pid]
chanaka@localhost:~#Where is proftpd
To start
sudo /etc/init.d/proftpd start
Subscribe to:
Posts (Atom)