Showing posts with label FTP. Show all posts
Showing posts with label FTP. Show all posts

Wednesday, 23 November 2011

Enable FTP service in Unix server

How to enable FTP access:

1./etc/services : Check this file and uncomment the ftp lines.

2.Check the port 21 is established or not on ur server.

3./etc/inetd.conf : Check this file for ftp entry should be there.
If it is not there please put the entry and enble it.

4.Restart the inetd by use the commnd
#inetd -c

5.start the ftp service : #/sbin/init/ftp start
Stop the ftp service : #/sbin/init/ftp stop


Files controlls FTP acess:

1./etc/ftpd/ftpaccess --> configuration file is the primary configuration file for defining how the ftpd daemon operates. It is not necessary to enable the ftpacess file inorder to run ftpd. The configuration files allow you to configure FTP features, such as the number of FTP login tries permitted, FTP banner displays, logging of incoming and outgoing file transfers, access permissions, use of regular expressions, etc.

2. /etc/ftpd/ftpconversions -->Defines options for compression/decompression and tar/untar operations

3./etc/ftpd/ftphosts -->Lets you allow/deny FTP account access according to source IP addresses and host names.

4./etc/ftpd/ftpusers --> Restricts FTP access for specified users. This file shows entries which dont have access for ftp.
deny ftp access to selected users.

5./etc/ftpd/ftpgroups -->The group password file for use with the SITE GROUP and SITE GPASS commands

Also check for :
2./etc/passwd --> anonymous ftp access

3.~/.netrc -->login information for ftp.The .netrc file contains login and initialization information used by the ftp autologin process .ftp autologin
allows users to ftp to other hosts.

Setup secure FTP in HP Ux : How to ??


1. Download and install the latest OpenSSH software from software.hp.com


2.Create a user called "user1" and setup password for that user


3. Make sure that user is able to login to the system using his password


4. Make the user to sftponly user by running the following command. Follow the instructions.


    # /opt/ssh/utils/ssh_chroot_setup.sh


5. The above command will create the necessary ftp directory structure. If /ftproot was selected as the root directory for the user, then all the /usr, /etc, /dev, /bin directory structure and the required commands like ls, cd, mv, etc.. are copied to the directory structure created.


6. Copy /opt/ssh/utils/sftponly to /bin and /ftproot/bin directory


    # cp /opt/ssh/utils/sftponly
    # cp /opt/ssh/utils/sftponly /ftproot/bin/sftponly


7. Add /bin/sftponly entry to /etc/shells file


    # echo "/bin/sftponly" >> /etc/shells


8. Modify the user1's home directory and shell in /etc/password as follows.


    user1:x:1000:1000:chrooted user:/ftproot/./home/user1:/bin/sftponly  


9. Make sure the user1 home directory is created if not already created


    # mkdir -p /ftproot/home/user1
    # chown user1 ftproot/home/user1


10. Now, the user is jailed within /ftproot directory. Also, user1 can not login to the system using ssh since his shell is set as /bin/sftponly.