PDA

Bekijk de volledige versie : adding users/changing file permissions with chown/login shell-upload rights for ftp



sup
27-06-2005, 16:08
I got my vsftpd server running fine after some time and effort:-). People can access the server and download from it, but I did not manage to make them able to upload files. I reasoned as follows:in order to be able to upload files, they need a write permission to a certain folder on the server. So an user must be created with such right, provided the people log on to ftp server as this new user. Or is there any other way to do this, than adding users?

So, I read this: http://wl500g.dyndns.org/ and changed my passwd file to this (the file is stored through flashfs)

admin:CENSORED;-):0:0:root:/usr/local/root:/bin/sh
nobody:x:99:99:nobody:/:/sbin/nologin
ftp:CENSORED;-):1001:1001:ftpaccount:/tmp/harddisk/Uploads:/bin/sh
and my group file to this:

root:x:0:admin
nobody:x:99:
ftp:x:1001:

according to this: http://floppix.ccai.com/adduser.html
However, when I saved the files, rebboted and tried to log on as user ftp, it said "login incorrect". Also, when I tried to change the ownersihp of Uploads folder on my harddisk to this user, this happened:

$ chown -R ftp /tmp/harddisk/Uploads
chown: /tmp/harddisk/Uploads: Operation not permitted
chown: /tmp/harddisk/Uploads: Operation not permitted

My guess would be that it is not a good idea to have the same shell script for root and for any other user, but I just tried that in order to test if it is working, and it is not. Sincerely, I do not have very much of an idea, what this is - shells are supposed to be in /etc/shells directory, but noithing is there on my asus:-/.
Any idea as to what to do?

sup
12-07-2005, 18:25
It seems I found out what to do - mostly thanks to this thread http://wl500g.info/showthread.php?t=2798.
It seems that it is impossible to use chown or chmod commands on windows formated partitions (ergo FAt or NFTS).
So I created 10GB partition ext3, created folder "uploads" on my harddisk (otherwise the partition would not mount) and add a line to my post-mount file that makes this partition mount on /tmp/harddisk/uploads. Then I changed the ownership to my ftp user and everything works fine now (ftp users can upload files but cannot delete them).

cthings
07-09-2005, 20:47
Hi Sub,

when you log on as user ftp, it said "login incorrect", how dit you log on? using telnet or ssh? if so probably your password is incorrect (typo?) Also, does the directory /tmp/harddisk/Uploads exist? Did you actually set a password for the user ftp using dsomething like:
"passwd ftp" ?

When changing the ownership of a directory you need to have the right rights: either you are the owner of the dir, or you are the super user (admin in this case)

grtz,
CThings