sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
dlite922's Avatar

Create a very limited user (access to one folder only)


Question posted by: dlite922 (Site Addict) on August 22nd, 2008 09:35 PM
I'm creating a batch file to be run on scheduled task on windows that sftp's a file using winscp to a linux machine.

The password is saved in this bat file for all to see, so i need to create a user on the Linux machine that can't do anything but have write access to 1 folder.

I don't want you to walk me through it from A to Z, but after I created the user, how do I do things like:

- cannot log into server using command line (SSH), if possible.
- make sure only one folder is allowed to access via sftp, and nothing else, not even home directory. can I eliminate home directory?


I might consider the home directory "be" the one folder that they have access to, if that's easier.

Also any pointers on how I can only allow txt file to be sent, no exe, pl, etc extensions allowed?

thanks guys,







Dan
2 Answers Posted
mrmr's Avatar
mrmr August 24th, 2008 02:26 PM
Newbie - 1 Posts
#2: Re: Create a very limited user (access to one folder only)

The standard way to confine sessions is through the 'chroot' call.
google for 'chroot jail sftp' and you'll find lots of step by step guides.

The 'extension' of a file has no meaning on the linux box and is just part of the name, I'm not aware of a simple mechanism to outlaw certain names.
Laharl's Avatar
Laharl August 24th, 2008 05:13 PM
Expert - 844 Posts
#3: Re: Create a very limited user (access to one folder only)

You could probably do it through a combination of chmod and regular expressions, though. Were I to guess, a shell script would be required to effeciently do this, probably one that runs every so often to ensure that new files are also chmod'd properly.
Reply
Not the answer you were looking for? Post your question . . .
197,046 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,046 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Linux / Unix / BSD Contributors