Centos vsftp

I am new to Linux and would like to setup an ftp server.  I have installed vsftpd server and so far if I try to login with a user account I get the user's home directory.

How can I create a single repository for:

 -  a group of users to upload but not see what they uploaded after they are done (write only)
 - a single user that can see all of the files uploaded to the repository (read, write, delete)

Thank you for your help in advance
thomasm1948Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thomasm1948Author Commented:
OK,

I just tried the following:

usermod -d /ftpRepo testUser

This gives the user the ability to browse up into the directories.  How can I restrict and how can I grant only write only.  and for the manager read, write, delete
0
MazdajaiCommented:
You can disable the dirlist option in vsftp, all directory list commands will give permission denied. Ultimately users will not able to run the list command and see what they uploaded.
dirlist_enable=NO

Open in new window

0
thomasm1948Author Commented:
I tried that, but then I am unable to login.  I get an error indicating that I am not able to that permissions are denied
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

MazdajaiCommented:
Can you post your vsftp.conf file?
0
SandyCommented:
you must be trying with "root" by default root is denied.. try with any normal user which is not listed in below files

/etc/vsftpd/ftpusers
/etc/vsftpd/user_list

TY/SA
0
thomasm1948Author Commented:
I did I created new users
0
SandyCommented:
give me output of

#sestatus

#sestatus -b | grep -i ftp

TY/SA
0
thomasm1948Author Commented:
here is my config

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above 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 directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
0
thomasm1948Author Commented:
Is it possible to create one user to upload only and not see the directory and have one user that can see everything

I am stuck on this one
0
thomasm1948Author Commented:
I also noticed that I cannot open the ftp site in explorer
0
thomasm1948Author Commented:
When I run

sestatus -b | grep -i ftp

Nothing is displayed
0
thomasm1948Author Commented:
I am enabling selinux now
0
thomasm1948Author Commented:
[root@ProxySvr01 ~]# sestatus -b | grep i ftp
grep: ftp: No such file or directory
0
SandyCommented:
Don;t enable selinux


#sestatus

#sestatus -b | grep -i ftp  

(u forogt using "-" )

TY/SA
0
thomasm1948Author Commented:
I get this:

[root@ProxySvr01 ~]# sestatus -b | grep -i ftp
allow_ftpd_anon_write                       off
allow_ftpd_full_access                      off
allow_ftpd_use_cifs                         off
allow_ftpd_use_nfs                          off
ftp_home_dir                                off
ftpd_connect_db                             off
ftpd_use_fusefs                             off
ftpd_use_passive_mode                       off
httpd_enable_ftp_server                     off
tftp_anon_write                             off
tftp_use_cifs                               off
tftp_use_nfs                                off


should I disable selinux
0
thomasm1948Author Commented:
Attached is what I get for my test user
test-user-login.JPG
0
SandyCommented:
ok..

either run

#setenforce 0

or run

#setsebool -P allow_ftpd_full_access on
#setsebool -P ftp_home_dir on

TY/SA
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thomasm1948Author Commented:
I get the same results as the image file

I ran
usermod -d /ftpRepo test1
usermod -d /ftpRepo test2

test1 is my user to upload fils only but cannot see whats in the folder
test2 is my user that should have full access to only that folder

both users should be able to move up in the directory

thank you for your help, if I can get those two users to work correctly it would be great.  So far they see the same thing.  the ftpRepo folder is empty right now so they both shouldn't see anything
0
thomasm1948Author Commented:
sorry both users should not be able to move up into the other directories
0
SandyCommented:
is your ftp started working ?

TY/SA
0
thomasm1948Author Commented:
The first image that I uploaded was from Internet explorer.  The attached is from firefox
firefox-error.JPG
0
thomasm1948Author Commented:
vsftpd is started
0
thomasm1948Author Commented:
no the two users are not working correctly
0
thomasm1948Author Commented:
both users is Internet explorer sees all of the folders.  In firefox I et an error
0
thomasm1948Author Commented:
ok, fixed the issue with home directories to point to ftpRepo.  Firefox still allows to move up into other directories and Internet explorer does not allow it.

still have an issue on how to enable test1 to only be able to upload files into the directory and not see anything in it even after they have uploaded the file

and I still have the issue that test2 should have full control of the folder.

I also noticed that I cannot open the ftp in file explorer to upload a file
0
thomasm1948Author Commented:
OK,

So now I figure that I could give test2 ownership to the folder and that seems to work, but test1 one I am having trouble giving right permissions only.  I tried chmod 730 /ftpRepo and that did not work.  I also tried 772 with no success.  The last number I figure to be others and that id write only (2).

I get an error 500 OOPS: cannot change directory:
0
thomasm1948Author Commented:
I think I got it.  I use chmod 773 /ftpRepo

I guess I needed execute along with read
0
thomasm1948Author Commented:
I meant to say I needed execute with write
0
thomasm1948Author Commented:
Hold I thought it was working but it seems to fail to upload the file for my test user.
0
thomasm1948Author Commented:
I forgot to refresh it is working
0
MazdajaiCommented:
Great. Are you all set now?
0
thomasm1948Author Commented:
thank you for leading in the correct direction
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.