USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

FTP server help

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Servers and Server Administration
View previous topic :: View next topic  
Author Message
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Fri Jun 22, 2024 9:57 pm    Post subject: FTP server help Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mushroom
Ultimate Member


Joined: 29 Jun 2024
Posts: 2128
Location: Queen Charlotte B. C. Canada

PostPosted: Fri Jun 22, 2024 10:57 pm    Post subject: Reply with quote

Question
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
View user's profile Send private message Visit poster's website
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Mon Jun 25, 2024 2:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jada
Linux Guru


Joined: 13 May 2024
Posts: 3064
Location: Sun City, CA 92585

PostPosted: Mon Jun 25, 2024 2:55 pm    Post subject: Reply with quote

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!



_________________
openSUSE 11.1 Desktop KDE 4.3.1 buildservice Factory
Linux Mint 7 Desktop Gnome
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Mon Jun 25, 2024 3:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Mon Jun 25, 2024 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jada
Linux Guru


Joined: 13 May 2024
Posts: 3064
Location: Sun City, CA 92585

PostPosted: Mon Jun 25, 2024 4:25 pm    Post subject: Reply with quote

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.



_________________
openSUSE 11.1 Desktop KDE 4.3.1 buildservice Factory
Linux Mint 7 Desktop Gnome
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Mon Jun 25, 2024 5:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jada
Linux Guru


Joined: 13 May 2024
Posts: 3064
Location: Sun City, CA 92585

PostPosted: Mon Jun 25, 2024 7:00 pm    Post subject: Reply with quote

Let me ask,

you try to set up a game server?



_________________
openSUSE 11.1 Desktop KDE 4.3.1 buildservice Factory
Linux Mint 7 Desktop Gnome
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Mon Jun 25, 2024 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jada
Linux Guru


Joined: 13 May 2024
Posts: 3064
Location: Sun City, CA 92585

PostPosted: Mon Jun 25, 2024 10:32 pm    Post subject: Reply with quote

Here a some good help files

http://gentoo-wiki.com/HOWTO_SFTP_Server_(chrooted,_without_shell)

http://uhacc.org/tech_docs/guides/sftp.html

http://www.cs.columbia.edu/~crf/howto/crfssh/more.html

now you got something to read over night Wink



_________________
openSUSE 11.1 Desktop KDE 4.3.1 buildservice Factory
Linux Mint 7 Desktop Gnome
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Tue Jun 26, 2024 2:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
cain
New Member


Joined: 09 Aug 2024
Posts: 1

PostPosted: Thu Aug 09, 2024 3:04 pm    Post subject: Reply with quote

Hello,

I have some problems with configuration.
I did everything from the list... step by step and I cannot connect with ftp.

Code:
[root@ywing vsftpd]# chown root:ftp-users /home/ftp-docs/*
chown: cannot access `/home/ftp-docs/*': No such file or directory
[root@ywing vsftpd]# mkdir /home/ftp-docs
mkdir: cannot create directory `/home/ftp-docs': File exists
[root@ywing vsftpd]# chown root:ftp-users /home/ftp-docs/*
chown: cannot access `/home/ftp-docs/*': No such file or directory
[root@ywing vsftpd]# mc

[root@ywing /]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]
[root@ywing /]# mkdir /home/ftp-docs
[root@ywing /]# chmod 750 /home/ftp-docs
[root@ywing /]# chown root:ftp-users /home/ftp-docs
[root@ywing /]# userdel user1
[root@ywing /]# useradd -g ftp-users -d /home/ftp-docs user1
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
[root@ywing /]# useradd -g ftp-users -d /home/ftp-docs user2
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
[root@ywing /]# chown root:ftp-users /home/ftp-docs/*
chown: cannot access `/home/ftp-docs/*': No such file or directory
[root@ywing /]# chown root:ftp-users /home/ftp-docs/*
chown: cannot access `/home/ftp-docs/*': No such file or directory
[root@ywing /]#


Can you ask you for any help, please? Confused

Always when I try to connect with ftp it says that:

500 OOPS: cannot change directory :/usr/local/apache/htdocs/ftp-docs/

Sigh.


Back to top
View user's profile Send private message
Nic
New Member


Joined: 07 Jun 2024
Posts: 34
Location: Colorado Springs, Co

PostPosted: Thu Aug 09, 2024 3:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Servers and Server Administration All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse