Restrict access for one usergroup via permissions

Posted on 2009-05-12
Last Modified: 2013-12-16
I have a single user on a server of mine that I need to have them scp files to their directory where a script will then run, and take control/ownership of the files.  I do not want this user to even see other directories or move about.  I tried chroot jail before but that has security holes that you can drive a truck through.  However I'm having a real problem understanding, and getting permission restrictions to work.  I could chmod directory by directory? but then wouldn't I also lock out other users/ groups that need to run processes?

Question by:Illyankesh
  • 3
  • 2
LVL 40

Assisted Solution

omarfarid earned 400 total points
ID: 24371253
if your are using vsftpd then please see link below:
LVL 14

Assisted Solution

small_student earned 100 total points
ID: 24374145
To give him limited shell access you can use sftp and limited shell, check this


Author Comment

ID: 24380558
Blegh tried your solution Omarfarid.... went through the conf file line by line, and after following your steps, and restarting vsftpd...I can still move around the file system with a user who is on the list to be denied....
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

LVL 40

Expert Comment

ID: 24381358
can you post your conf file?

Accepted Solution

Illyankesh earned 0 total points
ID: 24381847
Here ya go.  What did I miss?
# 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.



# 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.



# Allow anonymous FTP? (Beware - allowed by default if you comment this out).



# Uncomment this to allow local users to log in.



# Uncomment this to enable any form of FTP write command.



# 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)



# 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.



# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.



# Activate directory messages - messages given to remote users when they

# go into a certain directory.



# Activate logging of uploads/downloads.



# Make sure PORT transfer connections originate from port 20 (ftp-data).



# 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!




# You may override where the log file goes if you like. The default is shown

# below.



# If you want, you can have your log file in standard ftpd xferlog format



# You may change the default value for timing out an idle session.



# You may change the default value for timing out a data connection.



# 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.



# 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.



# 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.




# You may fully customise the login banner string:

ftpd_banner=Welcome to the adversarial ftp service bribery welcomed.


# You may specify a file of disallowed anonymous e-mail addresses. Apparently

# useful for combatting certain DoS attacks.


# (default follows)



# 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.



# 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().


# (default follows)



# 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.




# 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.



# This string is the name of the PAM service vsftpd will use.



# This option specifies the location of the RSA certificate to use for SSL

# encrypted connections.


# This option specifies the location of the RSA key to use for SSL

# encrypted connections.


Open in new window


Author Comment

ID: 24415394
Figured out solution using

The directory structure in the script is different than what is posted on the web, and another expert fixed the issue.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now