LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 03-19-2010, 12:37 AM   #16
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32

I'll have a look at the vsftpd.conf file now

TT ( karl )
 
Old 03-19-2010, 12:39 AM   #17
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
See if write option is enabled or not, look for this entry:
Quote:
# Uncomment this to enable any form of FTP write command.
write_enable=YES
 
Old 03-19-2010, 12:44 AM   #18
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by sayan_acharjee View Post
See if write option is enabled or not, look for this entry:
Yer thats OK, I see that I dont have SELinux if going by this quick search I did to find what SELinx was, LOL, never heard of it before.

I read that the path is
Code:
/etc/selinux/config
I dont think its installed I did whereis and got
Code:
selinux:
TT ( karl )
 
Old 03-19-2010, 12:52 AM   #19
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
To view selinux is enabled or not, run this command:
Quote:
#sestatus
I guess you've checked that write_enable=YES,anon_upload_enable=YES and anon_mkdir_write_enable=YES in the vsftpd.conf file?
 
Old 03-19-2010, 01:13 AM   #20
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by sayan_acharjee View Post
To view selinux is enabled or not, run this command:


I guess you've checked that write_enable=YES,anon_upload_enable=YES and anon_mkdir_write_enable=YES in the vsftpd.conf file?
Here's what I got

Code:
sestatus
The program 'sestatus' is currently not installed.  You can install it by typing:
sudo apt-get install policycoreutils
sestatus: command not found
I was going to use the command sudo apt-get install selinux

vsftpd is like so
Code:
# Example config file /etc/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.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#listen_ipv6=YES
#
# 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=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
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=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=whoever
#
# 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.
# Note that the default log file location is /var/log/xferlog in this case.
#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 restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# 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
#
#
# Debian customization
#
# Some of vsftpd's settings don't fit the Debian filesystem layout by
# default.  These settings are more Debian-friendly.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
Another question thou

How do I undo what I did before

Code:
sudo setfacl -m d:u:tommytomato:rw /var/www
Or wouldn't that have taken affect yet ?

I found vid about acl's

Here's what I've learnt

to create a new group
Code:
sudo groupadd menewgroup
then add user to that group and create password
Code:
sudo useradd -Gmenewgroup newuser
then do the newuser password
Code:
sudo passwd newuser
add acl to fstab file then reboot later

then mount
Code:
sudo mount -o remount /
then give permissions for it
Code:
sudo setfacl -Rdm g:menewgroup:rwx var/www
Not sure about the permissions, I want to be able to upload/writet/mod and allow appz like joomla, wordpress, gallery to write/delete and so on when you use CMS software

I'm still lost but I'm giving it ago and trying to under stand it

TT ( karl )

Last edited by tommytomato; 03-19-2010 at 01:18 AM.
 
Old 03-19-2010, 01:34 AM   #21
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
I can see this line in vsftpd.conf:
Quote:
#chown_uploads=YES
Remove the # from the front, don't know it will work or not but I found it like this in my vsftpd.conf file which is working properly.

You can see the effective acl in the folder with the following command:
Quote:
Quote:
#getfacl /var/www
To remove acl from that directory you can use:
Quote:
#setfacl -x u:username /var/www
 
Old 03-19-2010, 01:42 AM   #22
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Cheers for that

So does one need to install SELinux for this to happen

does what I've learnt make any sense, I haven't actually done it yet, I write it all down on paper to try understand it better first then hit the command line, I'm trying to keep the system as clean as possible with installing to many programs

TT ( karl )
 
Old 03-19-2010, 01:44 AM   #23
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
No, you don't need selinx to make it work.
By the way, which is the error gftp is throwing when you are trying to upload? There should be an error no, like 553 or 550.

Last edited by Sayan Acharjee; 03-19-2010 at 01:46 AM.
 
Old 03-19-2010, 01:53 AM   #24
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Its a 533 Sayan

TT ( karl )
 
Old 03-19-2010, 01:57 AM   #25
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by sayan_acharjee View Post
I can see this line in vsftpd.conf:

Remove the # from the front, don't know it will work or not but I found it like this in my vsftpd.conf file which is working properly.

You can see the effective acl in the folder with the following command:


To remove acl from that directory you can use:
I un comment the chown_uploads=YES still throws up a 533

TT ( karl )
 
Old 03-19-2010, 02:05 AM   #26
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
when running this command
Code:
#sudo setfacl -x u:username /var/www
doesn't it remove the user from the list ? because it's still there

Code:
tommytomato@rockinghamgateway:~$ sudo setfacl -x u:tommytomato /var/www
tommytomato@rockinghamgateway:~$ getfacl /var/www
getfacl: Removing leading '/' from absolute path names
# file: var/www
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:tommytomato:rw-
default:group::r-x
default:mask::rwx
default:other::r-x

tommytomato@rockinghamgateway:~$
TT ( karl )
 
Old 03-19-2010, 02:09 AM   #27
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
As you have created the acl with d: its still there with the default option, use this instead:
Quote:
Quote:
setfacl -x d:u:tommytomato /var/www

Last edited by Sayan Acharjee; 03-19-2010 at 02:12 AM.
 
Old 03-19-2010, 02:13 AM   #28
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by sayan_acharjee View Post
As you have created the acl with d: its still there with the default option, use this instead:
That did it cheers, I'm going to try what I learnt by creating new group and new user and see if that makes a difference to the issue I'm working on

so the d stands for default ?

TT ( karl )
 
Old 03-19-2010, 02:24 AM   #29
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
Well I dont know whats going on at all, I did what I learnt, it did even create its home directory the new user is not able to login via FTP at all

comes up with a 500 error

TT ( karl )

Last edited by tommytomato; 03-19-2010 at 02:26 AM.
 
Old 03-19-2010, 02:38 AM   #30
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 592

Rep: Reputation: 64
Can you please post the permissions of /var/www directory?
Here is the permissions assigned to the directory of my system which is used by user h11 to upload files with gftp:
Quote:
drwxrwsrwx+ 2 h11 ftp 4096 2010-03-18 16:51 /var/h11
here the + sign indicates that an acl is implemented on the directory, and here the directory name and user name is same.
Its working fine in my system, see if you can get some ideas from this.
 
  


Reply

Tags
gftp, wine


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
www-data execute iptables Legolas891 Linux - Security 2 12-22-2009 04:36 PM
Problem user www-data on ubuntu mosesdel Linux - Server 2 03-31-2009 07:45 PM
www-data password / authorization (newb) helsing Linux - Server 7 04-19-2008 10:51 AM
Why does www-data have /bin/sh as a shell? reverse Debian 2 11-18-2007 08:35 AM
add www-data user restless Linux - Newbie 1 06-01-2004 08:51 AM


All times are GMT -5. The time now is 01:02 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration