Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp issues....help! 1

Status
Not open for further replies.

jeffvb9

Technical User
Nov 14, 2002
44
US
Running vsftpd for ftp...on RH 8.

Can log into my linux box as anonymous and can log in as my local username also. The anonymous users home directory is /var/ftp/incoming. The anon. user is now stuck in this directory. Cannot see any files in the folder and cannot upload files into that directory. I also cannot cd into the incoming directory with my local user account as well as uploading files. I need them to do both. I have everything set up properly in the vsftp.conf file. Here is what the permissions look like on the /var/ftp directory:

d--x--x--x 2 0 0 bin
d--x--x--x 2 0 0 etc
drwxr--r-- 2 0 0 incoming
drwxr-xr-x 2 0 0 lib
drwxr-xr-w 2 0 0 outgoing

any ideas?

 
In many cases, the ftp user is chrooted (jailed) in their home directory. This means that user 'ftp' will be confined to the dir you specified for that user. They will only be able to see that directory and directories under it. So if you want them to see everything under /var/ftp/, then that should be ftp's home directory. If you want 'some' local users to be able to cd outside their home dir, then uncomment #chroot_list_enable=YES in vsftpd.conf. Then any user in /etc/vsftpd.chroot_list will NOT be jailed. To be able to upload to a directory, you will need to change the permissions. The owner AND group must be able to write to this directory. If you don't want to make the directory world writable, then you need to create or use a common group for all ftp users. Anon users belong to the group ftp, You can add a secondary group for your local users. For example, user joe belongs to group joe and ftp. Now what ever directory and file permissions you give to the 'group' will apply to both anon and loal users.
 
Thanks for the info....can you elaborate on some of the answers:

1) If I uncomment #chroot_list_enable=YES then how do i put users into the vsftpd.chroot_list file. That file isnt there.

2) How do I change the permissions to allow to upload files into a particular folder? I am not too familiar with chmod.
 
1) Create the file /etc/vsftpd.chroot_list with a text editor and add the names of the users you do NOT want to be chrooted.

2) You can use chmod in a couple different ways. The one used by ftp is the octal values with a 3 digit number. The first digit is user/owner. The second digit is group, and the third is world. The value of each digit depends on what you want each of these three to be able to do. Let's say read=4, write=2 and execute=1. Now let's say we want the owner to be able to do all three 4+2+1=7 and you want the group and world to just read and execute they would both end up with 4+1=5. So the three digit number would be 755. If you want this to apply to a file, then you would use the command 'chmod 755 filename'. If you wanted it to apply to a directory and all it's sub-directories then you would use 'chmod -R 777 dirname'.
 
ok...more issues. I am getting the hang of this though. I have setup the user 'guest'. They can log in as guest and can do just about everything inside /var/ftp. They can cd into any of the directories inside /var/ftp. I just want them to be able to go in and out of /incoming, /outgoing and be able to get and put files into those directories. I dont want them to be able to get to /etc, /bin, or /lib. Here are what the directories look like:

drwxrwxr-- 2 root guest incoming
drwxr-xr-x 2 root root outgoing

any ideas?

1) Does this mean that the owner root and group guest have read, write, execute permissions to incoming? I am still confused with owner and group.
2) Do I set up the group in the user gui interface and then make the home directory /var/ftp/incoming if thats where I want them to start out?
3) What exactly does owner and group mean?

Thanks
 

1) Yes. the three bits for owner and group are rwx.

2) Yes.

3) Owner is the user that created the file (in most cases) or could also later have been given ownership of it.
Group is the permissions of the whole group of users. You can probably see the groups in the user tool.

About the first question:
On directories, the 'x' bit controls if you can 'cd' to the directory and the 'r' bit controls read access.
This means:

drwx--x--- 2 root guest bin

Guest group can't do 'ls bin' but *can* do 'cd bin'. Even after cd'ing in there, he still can't 'ls' though so it's kind of a guessing game what you're doing. Guests can't create new file in the directory either.

drwxr----- 2 root guest bin

Guest group can't do 'cd bin' but *can* do 'ls bin'. He can not read or copy the files out there or create a new file.

Hope that cleared things up.
Do 'chmod 700 dir' on the directories you want to close for guests.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top