Wednesday 23 November 2011

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.

No comments:

Post a Comment