Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-09-2009, 02:34 PM   #1
Registered: Nov 2008
Posts: 158

Rep: Reputation: 30
How to lock user in his home directory on a Debian SSH Server?

I'm presently running a debian box, and I want to add a user, however I don't want the user to have sudo or root privileges, as well as I don;t want the user to be able to leave his home directory (can't go to /, just stay locked at /home/username). How do I do this? Is a VSFTPD what I need?
Old 07-09-2009, 04:08 PM   #2
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Old 07-09-2009, 04:15 PM   #3
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55

Found this by Googling "ssh chroot user".
Old 07-09-2009, 04:17 PM   #4
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
It depends on what you want the user to be able to do. If you only want the user to upload/download files, an FTP server is a way (and in my opinion the easiest way).
My approach there is to create a normal user but set the shell to something like /bin/false or /bin/nologin (depending what is available on the system). This will block normal login access. Next setup (the user on) the FTP server. For the latter, you can have a look at the FTP section of Miles Brennan's Linux Home Server HOWTO

If the user should be able to edit his/her files on the system, SSH is the way. It is however more complicated to jail the user to their home directory in my opinion. You can search for ssh jail to find the information.


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
SSH and User Home Directory htabesh Linux - Security 3 10-29-2008 09:13 AM
debian user home directory afzalmasood Debian 5 07-22-2008 11:31 AM
Locking SSH user to home directory. paroxsitic Linux - Software 2 04-03-2007 06:50 PM
VSFTPD - lock user to home directory ohleary Linux - Software 3 11-20-2003 03:04 PM
SSH lock users to the Home Directory jasonweb Linux - Security 2 04-11-2003 07:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:50 PM.

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