LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-05-2011, 02:44 PM   #1
jonty_11
Member
 
Registered: Sep 2004
Posts: 127

Rep: Reputation: 15
Disable "ls" command for a user when he FTPs


if I create a User in linux with useradd command
E.g.

useradd -s /bin/bash -d /home/testuser testuser

How can I make it such that he cannot run "ls" command when he FTPs into the server using the username/passwd I setup.

I would not mind disabling "ls" for SSh or FTP as long as user is unable to list all files in the home directory and is only able to use FTP commands like GET, PUT, RENAME etc...
Dont want them to have DELETE permission also...in this folder. This user will only be used for FTP...how can I enforce the above controls..

Using vsftpd in Linux CentOS...

Last edited by jonty_11; 04-05-2011 at 02:51 PM.
 
Old 04-05-2011, 03:30 PM   #2
tinyTux
Member
 
Registered: Mar 2011
Location: Extended Memory
Distribution: Gentoo
Posts: 64

Rep: Reputation: 9
Quote:
Originally Posted by jonty_11 View Post
if I create a User in linux with useradd command
E.g.

useradd -s /bin/bash -d /home/testuser testuser

How can I make it such that he cannot run "ls" command when he FTPs into the server using the username/passwd I setup.

I would not mind disabling "ls" for SSh or FTP as long as user is unable to list all files in the home directory and is only able to use FTP commands like GET, PUT, RENAME etc...
Dont want them to have DELETE permission also...in this folder. This user will only be used for FTP...how can I enforce the above controls..

Using vsftpd in Linux CentOS...
http://vsftpd.beasts.org/vsftpd_conf.html

According to the man page, VSFTPD(5), you set the following in your vsftpd.conf file to deny directory listing: (hint, hint... read the MANUAL page next time)

Code:
dirlist_enable
    If set to NO, all directory list commands will give permission denied.

    Default: YES
I'll let you read the rest of the MANUAL page to figure out the rest of your issues.
 
Old 04-05-2011, 04:17 PM   #3
jonty_11
Member
 
Registered: Sep 2004
Posts: 127

Original Poster
Rep: Reputation: 15
Thx for the help...

I am looking at the manual for another option..

following permissions wanted for one user group - GET, PUT, RENAME, APPEND, DELETE)

But another Group - I only want to allow GET, PUT, RENAME, APPEND

MAN doesnt give much info...
man vsftpd
VSFTPD(8) BSD System Manager€™s Manual VSFTPD(8)

NAME
vsftpd - Very Secure FTP Daemon

SYNOPSIS
vsftpd [configuration file]

DESCRIPTION
vsftpd is the Very Secure File Transfer Protocol Daemon. The server can be launched via a €œsuper-server€ such as
inetd(8) or xinetd(8). Alternatively, vsftpd can be launched in standalone mode, in which case vsftpd itself will
listen on the network. This latter mode is easier to use, and recommended. It is activated by setting listen=YES in
/etc/vsftpd/vsftpd.conf. Direct execution of the vsftpd binary will then launch the FTP service ready for immedi-
ate client connections.

OPTIONS
An optional [configuration file] may be given on the command line. This configuration file has to be owned by root.
The default configuration file is /etc/vsftpd/vsftpd.conf.

SEE ALSO
vsftpd.conf(5)
 
Old 04-06-2011, 10:11 AM   #4
jonty_11
Member
 
Registered: Sep 2004
Posts: 127

Original Poster
Rep: Reputation: 15
Found this - Can we retrict commands allowed on a per FTP user basis?
==================================================
vsftpd.conf has the following:
cmds_allowed
This options specifies a comma separated list of allowed FTP commands (post login.
USER, PASS and QUIT and others are always allowed pre-login). Other commands are
rejected. This is a powerful method of really locking down an FTP server. Example:
cmds_allowed=PASV,RETR,QUIT
------------------
 
  


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
[SOLVED] Disable "this session is being run as a privlidged user" smeezekitty Linux - Newbie 4 03-09-2010 12:06 AM
How to disable remore ssh login access of "root" user. ashishshukla Linux - General 3 10-07-2008 08:55 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Disable or fix "Switch User" in KDE? whysyn Linux - Software 1 01-06-2006 04:03 PM
Disable "switch user" in KDE peesz Linux - Software 3 11-18-2005 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:40 AM.

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