NIX Blogging

This Blog its all About Me

Wednesday, October 24, 2007

Install FTP @ OpenBSD

Setting up anonymous FTP Service

So easy working with OpenBSD, you can install OpenBSD without no problem at all. All you have to do just put /usr/bin/false to the /etc/shells.

# echo /usr/bin/false >> /etc/shells

And all set, now all you need is add nu user :

# adduser

Use option ``-silent'' if you don't want to see all warnings and questions.

Reading /etc/shells
Check /etc/master.passwd
Check /etc/group

Ok, let's go.
Don't worry about mistakes. There will be a chance later to correct any input.
Enter username []: pnyet
Enter full name []: ftp-user
Enter shell authpf csh false ksh nologin sh [ksh]: false
Uid [1002]:
Login group pnyet [pnyet]:
Login group is ``pnyet''. Invite pnyet into other groups: guest no
[no]: no
Login class _mysql authpf daemon default staff [default]:
Enter password []:
Enter password again []:

Name: pnyet
Password: ****
Fullname: ftp-user
Uid: 1002
Gid: 1002 (pnyet)
Groups: pnyet
Login Class: default
HOME: /home/pnyet
Shell: /usr/bin/false
OK? (y/n) [y]: y
Added user ``pnyet''
Copy files from /etc/skel to /home/pnyet
Add another user? (y/n) [y]: n

Directory Setup

You do not need to make a /home/ftp/users or /home/ftp/bin directory. Because when you add new user you automatically make new directory.

* /home/ftp - This is the main directory. It should be owned by root and have permissions of 555.
* /home/ftp/etc - This is entirely optional and not recommended, as it only serves to give out information on users which exist on your box. If you want your anonymous ftp directory to appear to have real users attached to your files, you should copy /etc/pwd.db and /etc/group to this directory. This directory should be mode 511, and the two files should be mode 444. These are used to give owner names as opposed to numbers. There are no passwords stored in pwd.db, they are all in spwd.db, so don't copy that over.
* /home/ftp/pub - This is a standard directory to place files in which you wish to share. This directory should also be mode 555.

Start The FTP Service

All you need now is start the ftp service using the inetd or from the rc. If you want the users using their home directories you have to edit a little at the /etc/ftpchroot.

Now its ready transfer files ...


Post a Comment

<< Home