LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-23-2004, 10:46 AM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Rep: Reputation: 31
Lock user in home dir


Is any way to lock a user in his home directory or to a specific dir [/opt/123/] ?
 
Old 03-23-2004, 11:22 AM   #2
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 15
what are you using? FTP?

if so, yes.. look up chroot
if you have not picked a ftp server a good one to look at is vsftpd with debian ... apt-get install vsftpd

good luck
Jesse
 
Old 03-23-2004, 02:15 PM   #3
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Original Poster
Rep: Reputation: 31
ssh
is possible to do something like this?

for ftp i have chosen glftpd
 
Old 03-23-2004, 02:52 PM   #4
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 15
here is a debian how-to..

http://www.debian.org/doc/manuals/se...sh-env.en.html

hope this helps
 
Old 03-23-2004, 03:13 PM   #5
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Original Poster
Rep: Reputation: 31
i dont want this exactly....

To be more specifig:
I want anybody be able to login using ssh. If he login as user "X" then will be moved to a specific dir (lets assume home) and be locked there!
In there will be able to do what he wants (make dirs, rename files etc) and run any ssh command

There is no need to use ftpd or any other service!
 
Old 03-23-2004, 03:43 PM   #6
tuxguy
Member
 
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 15
JJX - look at para G.2.
 
Old 03-24-2004, 12:11 AM   #7
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Original Poster
Rep: Reputation: 31
i am wokring on it
thx a lot
 
Old 04-17-2007, 07:57 PM   #8
jetpeach
LQ Newbie
 
Registered: Apr 2005
Posts: 17

Rep: Reputation: 0
easy way?

i'm looking over the linked page from this thread, i'd like to do exactly what the poster is talking about. can anybody help guide me more with this? i'm not sure what exactly the link is saying to do
 
Old 05-07-2009, 12:52 AM   #9
hai_indya
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
Thumbs up Venkat's Reply for Restricting the user in his Home dir

Quote:
Originally Posted by JJX View Post
Is any way to lock a user in his home directory or to a specific dir [/opt/123/] ?
Yes, it is possible to restrict the user in his home dir.
To change the user home dir, pl follow below steps.

1)
[root@venkat]#userad -d /opt/123 <user name>
This is one way to change the default user home dir
2)
Change in /etc/default/useradd file
[root@venkat]# vi /etc/default/useradd
HOME=/opt/123

Restrict the user in his home dir:
Specify the user in /etc/security/chroot.conf

Example:

# /etc/security/chroot.conf
# format:
# username_regex chroot_dir
#matthew /home
venkat /opt/123

Save & Exit, thats all now.

Last edited by hai_indya; 05-07-2009 at 12:54 AM.
 
Old 06-28-2011, 02:09 PM   #10
doshinirav
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
I have a followup question about mounting other shared directories

What is the best way to mount a shared directory on a chroot'ed user.
Example:
User Home directory: /home/123
Shared Directory: /um/bal/

The Shared Directory will be accessed by all the chroot'ed users and they should have direct access to /um/bal

1. is it using the Mount command in the .bashrc file?
2. is it using the /etc/fstab ?
3. any other suggestions...?

Last edited by doshinirav; 06-28-2011 at 02:11 PM.
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 01:08 AM
lock new user into home dir eyewittness Linux - Security 4 06-19-2005 12:33 PM
recover user and home dir powadha Linux - General 5 04-16-2004 09:08 AM
how would i safely lock users to thier home dir? f1uke Linux - Security 2 07-22-2003 01:23 AM
Lock user in their home dir MarleyGPN Linux - Software 1 04-26-2003 05:12 AM


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

Main Menu
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