View previous topic :: View next topic |
Author |
Message |
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Fri Jun 22, 2025 9:57 pm Post subject: FTP server help |
|
|
Hey all, I'm running an vsFTPd server on CentOS 5. I currently have the server up and running. anonymous access is allowed and I have users setup. When i try to upload files from another computer, using windows and filezilla or the ftp built into the command prompt, i get the error: "533 cannot create file"
user1's home directory is set to folder /FTP
user1 is in groups user1, ftp, users, & wheel
user2's home directory is set to folder /FTP/user2
user2 is in groups user2. ftp, users, & wheel
and I habe chroot turned on so they are restricted to those files.
I am trying to test uploading a file using user1's profile to /ftp/user2/Inbox
which I currently have the permissions has rwxr----- wiht the owner listed as user1 and the group listed as ftp. I'm trying to make the inbox a file that user1 can put information in and user 2 can copy the information from but not delete it. any help here would be great.
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
mushroom Ultimate Member

Joined: 29 Jun 2025 Posts: 2128 Location: Queen Charlotte B. C. Canada
|
Posted: Fri Jun 22, 2025 10:57 pm Post subject: |
|
|
Have you set all the values in "/etc/vftpd.conf" correctly.
_________________ SuSE 8.0, 8.2, 9.0, 9.1, 9.2, 9.3, 10.0, 10.1, 10.2, 10.3, 11.0, 11.1
Live CDs Mepis 8.0, Puppy 4.3.1, netbook- Zenwalk 6.2
|
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Mon Jun 25, 2025 2:18 pm Post subject: |
|
|
As far as I can tell I have, because until I start adjusting the permissions the users go to the correct home and have access to their home directory and all sub folders. I will try to c/p the file in here in a few (currently bussy with teh new phone system lol)
I found out I should go through the command line/terminal to set the user permissions . I think the permissions that i need are dwrer-er-e, because I want user1 to own the files but I want all other users in the group to be able to open the folders and download the files. I will do a quick google for how to do that but I'll be checking back here every few minutes to see if anyone can outline the commands for me.
thanks
Nic
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
jada Linux Guru

Joined: 13 May 2025 Posts: 3064 Location: Sun City, CA 92585
|
Posted: Mon Jun 25, 2025 2:55 pm Post subject: |
|
|
Some commands for the Konsole Terminal
mode = su
Code: |
#su
# /etc/init.d/vsftpd start
# /etc/init.d/vsftpd stop
# /etc/init.d/vsftpd restart
# chkconfig vsftpd on
# netstat -a | grep ftp
tcp 0 0 *:ftp *:* LISTEN
anon_root=/data/directory
# Allow anonymous FTP?
anonymous_enable=YES
...
# The directory which vsftpd will try to change
# into after an anonymous login. (Default = /var/ftp)
anon_root=/data/directory
...
# Uncomment this to allow local users to log in.
local_enable=YES
...
# Uncomment this to enable any form of FTP write command.
# (Needed even if you want local users to be able to upload files)
write_enable=YES
...
# Uncomment to allow the anonymous FTP user to upload files. This only
# has an effect if global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
...
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
...
# Activate logging of uploads/downloads.
xferlog_enable=YES
...
# You may override where the log file goes if you like.
# The default is shown below.
xferlog_file=/var/log/vsftpd.log
# Allow anonymous FTP?
anonymous_enable=NO
# Uncomment this to allow local users to log in.
local_enable=YES
# service vsftpd start
# groupadd ftp-users
# mkdir /home/ftp-docs
chmod 750 /home/ftp-docs
chown root:ftp-users /home/ftp-docs
# useradd -g ftp-users -d /home/ftp-docs user1
# useradd -g ftp-users -d /home/ftp-docs user2
# useradd -g ftp-users -d /home/ftp-docs user3
# useradd -g ftp-users -d /home/ftp-docs user4
# passwd user1
# passwd user2
# passwd user3
# passwd user4
chown root:ftp-users /home/ftp-docs/*
chmod 740 /home/ftp-docs/*
write_enable = NO
# ll
total 1
-rw-r--r-- 1 root root 0 Jan 4 09:08 testfile
|
I hope it will help you a little! |
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Mon Jun 25, 2025 3:51 pm Post subject: |
|
|
Here is the vsftp.conf file:
Code: | anonymous_enable=YES
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_umask=033
anon_root=/FTP/anon
ftp_username=Linus
local_enable=YES
write_enable=YES
local_umask=002
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/etc/vsftpd/vsftpd.log
xferlog_std_format=YES
connect_from_port_20=YES
chown_uploads=NO
chown_username=Linus
idle_session_timeout=600
data_connection_timeout=120
nopriv_user=ftp
async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to Caption First FTP service.
deny_email_enable=YES
banned_email_file=/etc/vsftpd/vsftpd.banned_emails
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
#if turned on user must be in chroot_list to have only access to specified directory
background=YES
ls_recurse_enable=YES
listen=YES
listen_ipv6=NO
pam_service_name=vsftpd
userlist_enable=NO
userlist_file=/etc/vsftpd/user_list
tcp_wrappers=YES
pasv_min_port=20
pasv_max_port=22
pasv_address=192.168.1.51
use_localtime=NO |
I believe that I have everything setup properly, all I need is help on how to change user permissions in the Konsole Terminal
(Example:)
I want user1 to have access to all files in the /ftp/ directory read/write/execute so they can upload files and see all directories
I want user2 to only have access to /ftp/user2/ directories (which I have done by making it the user's home) and I want them to have access to download what is in /ftp/user2/Inbox but not delete it, and I want to make them able to upload to /ftp/user2/Outbox
From what I understand this can be done by placing user1 as the owner of /ftp/user2/Inbox and giving them full access and placing user2 in the group with read/execute ability.
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Mon Jun 25, 2025 4:19 pm Post subject: |
|
|
Ok, I set the permissions using the GUI as follows:
drwxr-xr-- for /ftp/user2/Inbox with the owner as user1 and the group as "users"
drwxrwxr-- for /ftp/user2/Outbox with the owner as user1 and the group as "users"
It appears to be working, i will do some more testing with user3 & user4 to see if I can do that properly, but I believe that its up and running (now all I have to do is setup the users & vsftpd.conf file on a serverbox instead of the laptp I've been testing it on)
Again thanks for all of the help
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
jada Linux Guru

Joined: 13 May 2025 Posts: 3064 Location: Sun City, CA 92585
|
Posted: Mon Jun 25, 2025 4:25 pm Post subject: |
|
|
Why you not going to add two differant groups?
group-1 permission /ftp/ directory read/write/execute
group-2 permission /how ever you like it
group-3 permission / if needed
then use
Code: |
#su
password
#gpasswd -a USERNAME group-1
#gpasswd -a USERNAME group-2
|
With this way you set up the group one's, and then just add the user to the group. |
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Mon Jun 25, 2025 5:27 pm Post subject: |
|
|
Ok, started the reconfiguration, I currently have users as follows:
user1 - group1 - /FTP
user2 - group1 - /FTP
user3 - group2 - /FTP/user3
user4 - group2 - /FTP/user4
I want to give user1 & user2 access to all files in /FTP, but none of the files above that; as well as I want user1 to be able to see user2's home directory, but not the other way around.
I want to give user3 & user4 access strictly to their home directories; as well as only being able to read from one specific folder and upload/download from another specific folder
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
jada Linux Guru

Joined: 13 May 2025 Posts: 3064 Location: Sun City, CA 92585
|
Posted: Mon Jun 25, 2025 7:00 pm Post subject: |
|
|
Let me ask,
you try to set up a game server? |
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Mon Jun 25, 2025 8:02 pm Post subject: |
|
|
I'm trying to setup a SFTP for my work, so we can have clients download *.mp3 files and upload the *.doc transcriptions of the files. Its basically so we can stop outsourcing the FTP service. My goal before I leave is to make the company self sufficient.
So I'm trying to get an FTP server up and running for clients to access whatever it is they need.
Setup a POP3/SMTP server for mail.
Make a web server for the website.
Then create comprehensive directions so if i need to leave I can and the instructions are there.
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
jada Linux Guru

Joined: 13 May 2025 Posts: 3064 Location: Sun City, CA 92585
|
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Tue Jun 26, 2025 2:40 pm Post subject: |
|
|
Thanks, I think I have it up and running, I just had to go back and document my work very well. I do have another question, but I think I'll open another topic seeing as hot its not directly related to the FTP server setup.
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
cain New Member
Joined: 09 Aug 2025 Posts: 1
|
|
Back to top |
|
Nic New Member

Joined: 07 Jun 2025 Posts: 34 Location: Colorado Springs, Co
|
Posted: Thu Aug 09, 2025 3:25 pm Post subject: |
|
|
Just want to make sure, you crated the directory:
/usr/local/apache/htdocs/ftp-docs/
Also make sure that the ftp user(s) have access to the directory
(sorry I'm still a bit of a noob, but I'll try to help best I can)
_________________ Knoppix - live CD
CentOS 5 vsFTPd & SAMBA
CentOS 5 (remote laptop)
|
|
Back to top |
|
|