Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Make a User who can't left his home-dir
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sentinal
n00b
n00b


Joined: 12 Jun 2002
Posts: 5

PostPosted: Wed Jun 12, 2002 3:50 pm    Post subject: Make a User who can't left his home-dir Reply with quote

Hello,
I want to create a user, who can't left his homedir and search my server. He should be able to use editors like nano or start other things.

What must I do so that he can't go a level higher?
Back to top
View user's profile Send private message
Xaanin
n00b
n00b


Joined: 09 Jun 2002
Posts: 26
Location: Stockholm, Sweden

PostPosted: Wed Jun 12, 2002 10:24 pm    Post subject: Reply with quote

The first question that pops up is: Why would you give this user an account in the first place? If you don't feel you can trust him enough to give him an account that can browse the whole system I don't see the point.

Now, on to your question, a chroot jail would probably do what you want, though they can be broken out of, it's the only solution I can think of. Man chroot and search google should give you something to start with.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Wed Jun 12, 2002 11:12 pm    Post subject: Reply with quote

Check your /root directory it doesn't have world acces (no rwx) chmod o-rwx <dir / filename>, this way only the user and group can access the directory.

So you could do this for your whole system, chroot environment probably easier.

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Thu Jun 13, 2002 1:12 am    Post subject: Reply with quote

lx wrote:
So you could do this for your whole system


OK, but if you do this on /usr/bin and /bin, you're going to be in for a nasty surprise when that user account can no longer log in to his shell...

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
noldar
Guest





PostPosted: Thu Jun 13, 2002 12:03 pm    Post subject: Reply with quote

Maybe rsh ( or krsh, bash -r) will do the trick. rsh = restricted shell, not to confuse with remoteShell.

Calling one of those shells restricted will disable the "cd" command, next to other stuff. That of course does mean, that the also won't be able to cd into subdirectories of his/her homedir.
The user will only be able to start programs in his/her path (and is not able to change the PATH variable). Usually, $PATH would be something like /usr/rbin, where all those programs would be installed (linked ?)

Otherwise, there is a chroot shell:

http://www.aarongifford.com/computers/chrsh.html
Back to top
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum