Basic Setting Proftp server and creating ftp account for a user who should login to some other directory other than home directory by default.

Install ProFTPD server

Type the following command as root user:
# yum install proftpd
Start ProFTPD when the system reboot:
# chkconfig --level 3 proftpd on
To start proftpd ftp service, enter:
# service proftpd start
To Stop proftpd ftp server, enter:
# service proftpd stop
To restart proftpd ftp service, enter:
# service proftpd restart
To reload the configuration file, enter:

# service proftpd reload

====================================================

Edit the file /etc/passwd

In the file search for the desired username and edit the default path to the current directory to which he should login

eg;

vel:x:501:502::/home/vel:/bin/bash

change the path of the home directory

vel:x:501:502::/path/to/current/directory:/bin/bash

Then set the necessary permission to the default directory

Either add this user to the group of that directory or change the ownership of the default directory to the new user ownership

===================================================

Edit the /etc/proftp.conf file

Check for the line DefaultRoot and edit or add new line as

DefaultRoot  /path/to/default/directory/  username

eg

DefaultRoot /var/www/html/modules/imageupload/  vel

save the file and restart the proftp

service proftpd restart

Then check from the client software of ftp..


Published in: on March 12, 2010 at 11:06 pm  Comments Off on Basic Setting Proftp server and creating ftp account for a user who should login to some other directory other than home directory by default.  

Linux : Upload the files and directory tree to remote ftp server

When you host your web site remotely and use the open source software’s like wiki, phpbb etc uploading them is pain from UNIX or Linux based computer, especially when these software releases new security fixes you need to upload bunch of files and subdirectories. ncftpget client program is neat handy utility for recursive remote ftp server uploading purpose.
Try ncftpput as follows:
$ ncftpput –R –v –u “username” ftp.nixcraft.biz /nixcraft/forum /tmp/phpbb
-u “username” : Ftp server username
-v : Verbose i.e. show upload progress
-R : Recursive mode; copy whole directory trees.
ftp.nixcraft.biz : Remote ftp server
/nixcraft/forum : Remote ftp server directory where all files and subdirectories will be uploaded
/tmp/phpbb : Local directory (or list of files) to upload remote ftp server directory /nixcraft/forum
1) See ftptreeupload.bash script to copy all files and subdirectories recursively and upload them to remote FTP server (copy local all directories/tree to remote ftp server)
2) ncftpput can be downloaded from http://www.ncftp.com/ncftp/ and works with FreeBSD, Solaris and all most all UNIX variant

Published in: on February 4, 2010 at 6:56 pm  Comments Off on Linux : Upload the files and directory tree to remote ftp server