2

I need a shell script that test that the new user can indeed upload and download files using passive mode of operation in proftpd.I had installed proftpd on /tmp and configuration file is /etc/proftpd.conf. please guys help me out here

 #! /bin/bash
#decompress the file 
mkdir /opt/$1
cd /opt/$1
wget http://ftp.swin.edu.au/proftpd/distrib/source/proftpd-1.3.3e.tar.gz
tar -xzf proftpd-1.3.3e.tar.gz
#configure it 
cd proftpd-1.3.3e
./configure --sysconfdir=/opt
#Make the file
make
#make install the extracted file
make install
#To add ftp user,group
useradd $2
groupadd $2
mkdir /home/$3
passwd $2
echo "User  $3 ">> /opt/proftpd.conf
echo "Group $3 ">> /opt/proftpd.conf
echo "DefaultRoot  ~ " >> /opt/proftpd.conf
echo "PassivePorts 30000 35000 ">> /opt/proftpd.conf
exit                                                     

1 Answers1

0
    echo -n "Enter FTP Username : " 
    read USER 
    echo -n "Enter password : " 
    read -s PASSWD 

    HOST='192.168.1.100' 
    ftp -n -v $HOST << EOT 
    ascii 
    user $USER $PASSWD 
    prompt 
    put file.txt 
    get file.txt 
    ls -la 
    bye 
    EOT