LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2006, 08:07 AM   #1
krneki
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Rep: Reputation: 0
vsftpd problem


Hello!

I own a linux server where is installed Fedora Core 3. I recently installed ftp server vsftpd. It's now configured that every user in /home has rights to access to his own account (directory) with a full control. Everything works fine, except one thing. I would like to create a new user account with full access to public directory. That means if someone (anonymous) would enter to browser ftp://myip he would be redirected to public dir XY and able to download/list files (without upload permission). There would be also user ABC which would have all permissions only to dir XY (his home directory), so he could upload and delete files (if logged in of course). Is there any way to do that?

And another question related to domain name. It's actually very simply. I would like to have domain name (which I already registered on eurodns.com) for my ip. So if someone would enter ftp://mydomain it would be the same if entered only my IP address. How can I do that?

Thank you very much for further help.

Regards,
krneki
 
Old 06-12-2006, 08:27 AM   #2
krneki
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Here is the situation:
I chmod-ed /var/ftp/pub to 755 permissions. Anonymous users have now permission only to read and copy files from public dir. The user which I created with home directory on /var/ftp has exact permissions - only permission to view and copy files, but I get 500 error if I try to upload something.
However, that's not what I need. I still want to allow anonymous users to view files (without upload/delete permission) and created user to upload/delete/create/view permissions on public directory.
Maybe there is a trick with chroot and chmod?
 
Old 06-12-2006, 11:07 AM   #3
zsoltrenyi
Member
 
Registered: May 2004
Distribution: redhat, trustix, debian
Posts: 103

Rep: Reputation: 15
I used to know vsftpd and as far I remember it should have something with anonymous access in vsftpd.conf. Yeap. Man page says:

anonymous_enable
Controls whether anonymous logins are permitted or not. If enabled, both the usernames ftp and anonymous are recognised as anonymous logins.

Default: YES

anon_upload_enable
If set to YES, anonymous users will be permitted to upload files under certain conditions. For this to work, the option write_enable must be activated, and the anonymous ftp user must have write permission on desired upload locations.

Default: NO
 
Old 06-13-2006, 12:46 AM   #4
krneki
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Here is my config file. Is everything OK with settings?
Quote:
# 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=YES
#
# 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=077
#
# 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=no
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=no
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
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=ftp
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
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 turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to bulek.be 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_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

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
anon_root=/var/ftp/pub
 
Old 06-13-2006, 01:40 AM   #5
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
Everything looks OK.

You might want to have another look at:
Quote:
# 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_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
If you wish to lock local users inside their home directories (so that they cannot browse the entire filesystem over ftp).

[EDIT]
One more thing.
Quote:
local_umask=077
This means that local groups cannot read/write/execute any files after they are uploaded. You might want to change the value to something like local_umask=027 but it really depends on what priviliges are allowed to groups inside the users' home directories.
[/EDIT]

Last edited by Notwerk; 06-13-2006 at 01:48 AM.
 
Old 06-13-2006, 02:00 AM   #6
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
Just took another read of your post and realized i had missed something. If i understand correctly, you want to have a directory where one local user has full access, but when anonymous users login they get that same directory but only with read permissions, right?

If this is so, you'll need to create a new local user with a home directory and shell access. The settings in vsftpd.conf are already correct to allow this new user full access to his/her home directory. Next you'll need to set the anonymous user's root directory to the same home directory of the new local user.
Code:
anon_root=/home/new_local_user/
Again, the settings in vsftpd.conf are already correct to limit anonymous users access to only reading files.

Now for your next question regarding Domain Name.
Is your external IP (the one assigned by your ISP when you conenct to the internet) static and doesn't change each time you connect? Or is it dynamic and changes each time?

Last edited by Notwerk; 06-13-2006 at 02:02 AM.
 
Old 06-14-2006, 07:41 AM   #7
krneki
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Original Poster
Rep: Reputation: 0
I considered Notwerk's proposition and here is what I get:
I made new user named ftp2 and change anon_root to /home/ftp2. User ftp2 can now login into his account and he has full control of home directory. The only problem is that anonymous users can't access to this directory (/home/ftp2). They everytime get error: "550 Failed to change directory". Anonymous users are still enabled in vsftpd.conf. I also tried to set 777 permissions to /home/ftp2 but nothing changed. Any new ideas?
 
Old 06-14-2006, 08:04 AM   #8
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
Make sure you chmod /home/ftp2 recursively (change permissions on all files and directories inside it).

If there are sub-directories inside /home/ftp2 then you'll need to allow all users "execute" permissions on the directories, in order to permit them to see what's inside them.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd settingd and VSFTPD DEAD BUT SUBSYS LOCKED pc_copat Linux - Newbie 15 11-05-2009 10:31 PM
vsftpd.conf/chroot/vsftpd.chroot_list issue Jerman Linux - Security 2 06-01-2007 07:24 PM
vsftpd problem krneki Linux - Networking 2 04-15-2006 01:17 PM
vsftpd & ssl - how do I tell if it's actually vsftpd maintaining the connections?? hunterhunter Linux - General 0 03-27-2006 04:41 PM
VSFTPD with 500 oops :vsftpd: missing argv[0] mole_13 Linux - Newbie 0 05-04-2005 01:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration