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! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-14-2010, 05:15 PM
|
#1
|
|
LQ Newbie
Registered: Apr 2010
Posts: 12
Rep:
|
User that can not move from his own home dir
is it possible to make that user can not move from his own home directory?
thank you in advance!
|
|
|
|
08-14-2010, 05:27 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,799
|
Quote:
Originally Posted by booyeeka
is it possible to make that user can not move from his own home directory?
thank you in advance!
|
Maybe, but you provide no details.
What KIND of user? (console? SSH? Telnet? FTP?). What version/distro of Linux? What you're talking about is "chroot", and can be done for SSH and FTP users. You can probably script something to make sure the user can't change directories above their own home dir, too, depending on what you're talking about.
|
|
|
|
08-14-2010, 05:29 PM
|
#3
|
|
Member
Registered: Jun 2010
Posts: 46
Rep:
|
simply...
You modify a shell profile for the user with an alias for cd command that will block/substitute his attempts to move elsewhere. Make the profile file writable to root only, so the user could not overwrite it, yes, don't forget exporting it.
I hope it helps. See "Learn Linux for a Beginner" DVDs by unixacademy.com for questions like that.
Last edited by myposts; 08-14-2010 at 05:30 PM.
|
|
|
|
08-14-2010, 05:31 PM
|
#4
|
|
LQ Newbie
Registered: Apr 2010
Posts: 12
Original Poster
Rep:
|
it's for ssh user.
so, let's call it regular-no-root user, that belongs to some custom group...
|
|
|
|
08-14-2010, 07:04 PM
|
#5
|
|
Member
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 689
Rep: 
|
Am I being to simple---->
chmod -R 700 / 
|
|
|
|
08-14-2010, 07:41 PM
|
#6
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,799
|
Quote:
Originally Posted by jv2112
Am I being to simple---->
chmod -R 700 / 
|
Yes...because with those permissions, no one except root could get to the /etc directory, to read default profile information, password/shadow files, etc. They'd also be unable to start a shell, since they're in /bin/bash, which would be excluded from the path by those permissions, not to mention all the applications you'd break by doing that recursively from root.
Quote:
|
Originally Posted by myposts
You modify a shell profile for the user with an alias for cd command that will block/substitute his attempts to move elsewhere.
|
..except that the user will then be unable to change directories WITHIN his own home directory.
Quote:
|
Originally Posted by booyeeka
it's for ssh user.
so, let's call it regular-no-root user, that belongs to some custom group...
|
You STILL say nothing about version/distro of Linux. Read my first post again, about SSH supporting chroot'ed users. It effectively making their own home directories look like the "/" directory. Since they're already effectively at top-level, they obviously can't go up, or anywhere else, if they're chroot'ed. Since you don't give any details about version/distro of Linux, go to Google and look up "linux chroot ssh" for your version. Follow the instructions.
Last edited by TB0ne; 08-14-2010 at 07:45 PM.
|
|
|
|
08-15-2010, 01:52 AM
|
#7
|
|
LQ Newbie
Registered: Apr 2010
Posts: 12
Original Poster
Rep:
|
it's fedora distro. but i don't know why it's distro-related...
|
|
|
|
08-15-2010, 02:03 AM
|
#8
|
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,816
Rep: 
|
You do realize you'll need to put copies of all the required binaries and libraries into the chroot'ed environment, right? Nine times out of ten when I see someone doing this they're going on a roundabout way to solve some particular problem. What exactly are you trying to accomplish by limiting a user to his home directory? On a well-secured system it's generally not a problem to let the user traverse the file system unless you have some very special requirements.
In any case look into chrooting ssh ... if you Google there are a number of guides on how to do it. You can also put bash into restricted mode which will let the user access needed binaries and libraries, but won't let them change directories at all IIRC so they're stuck in their home directory. Depending on your exact requirements, this may be good enough.
|
|
|
|
08-15-2010, 12:11 PM
|
#9
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,799
|
Quote:
Originally Posted by booyeeka
it's fedora distro. but i don't know why it's distro-related...
|
First, it's common courtesy to supply details when asking a question.
Second, as said before, the instructions/packages for setting up chroot'ed SSH vary by distro. So what works on Ubuntu, won't necessarily work on Fedora, that's why.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:54 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|