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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-24-2012, 07:57 AM
|
#1
|
Member
Registered: Dec 2008
Posts: 43
Rep:
|
"Locking" a user into a specific directory
Hi all
I've been asked to secure our OpenSuse server but I have no idea where to start and hope that someone can point me in the right direction (tutorials or examples would be greatly appreciated!).
The current situation is we have three local users: root, user1 and user2
Root and user1 are to be allowed "full access" to the file-system, but user2 can not be allowed outside of their home directory.
I *think* this is called jailing or something but as it's not something I've any experience with I was hoping for some pointers please
Many thanks for reading, I hope that someone can help!!
|
|
|
10-24-2012, 08:04 AM
|
#2
|
LQ Newbie
Registered: Jun 2012
Posts: 20
Rep: 
|
|
|
|
10-24-2012, 08:10 AM
|
#3
|
Member
Registered: Dec 2008
Posts: 43
Original Poster
Rep:
|
Quote:
Originally Posted by epislav
|
Wow, thank you for the prompt reply!
It does sound like the thing although typically, it's their shell access we need to restrict as they'll SSH in ... I will give it a whirl and, well, post back my results!
|
|
|
10-24-2012, 08:33 AM
|
#4
|
Member
Registered: Dec 2008
Posts: 43
Original Poster
Rep:
|
Hmm, unfortunately, following these instructions didn't work; user2 was able to move outside of /chroot/user2 ...
For reference, I have configured the user (via Yast) to have their home directory set to /chroot/user2 and then followed the guide (although I did get one error/warning:-
$PROMPT # cp -p /lib/{ld-linux.so.2,libc.so.6,libdl.so.2,libtermcap.so.2} lib/
cp: cannot stat `/lib/libtermcap.so.2': No such file or directory
Am I missing something or is there a different process for OpenSuse12.1 (as I notice this was a Mandriva specific guide)?
Thanks again!
|
|
|
10-24-2012, 09:02 AM
|
#5
|
LQ Newbie
Registered: Jun 2012
Posts: 20
Rep: 
|
Well, main part is "chroot directory /bin/bash" which will change root to <directory> and run /bin/bash in jailed enviroment
The cp stuff is to get bash and its libraries to chrooted directory
|
|
|
10-25-2012, 01:29 AM
|
#7
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
Quote:
but user2 can not be allowed outside of their home directory
|
.You can lock(jail) the user to home directory using /bin/rbash shell
http://www.cyberciti.biz/faq/restric...ectories-only/
|
|
|
10-25-2012, 03:34 AM
|
#8
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by arun5002
.You can lock(jail) the user to home directory using /bin/rbash shell
|
Note 'rbash' drastically reduces functionality and does not stack up to earlier mentioned chroot jail.
Quote:
Originally Posted by badger_fruit
I've been asked to secure our OpenSuse server but I have no idea where to start
|
Just asking since jail is all that has been addressed here: is that really all you needed to accomplish? I mean there's more to securing a server than confining user accounts.
|
|
|
10-25-2012, 03:46 AM
|
#9
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
@unspawn .Currently im using /bin/rbash shell to lock (or) jail the user to home directory .Whether there is any other method available to lock the user to there home directory via ssh.
|
|
|
10-25-2012, 04:03 AM
|
#10
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by arun5002
@unspawn (..) any other method available to lock the user to there home directory via ssh.
|
For questions that do not help solve or address the OPs questions please create your own thread next time, OK? For modern OpenSSH versions see the "ChrootDirectory" directive.
|
|
1 members found this post helpful.
|
10-25-2012, 10:35 AM
|
#11
|
Member
Registered: Dec 2008
Posts: 43
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
Just asking since jail is all that has been addressed here: is that really all you needed to accomplish? I mean there's more to securing a server than confining user accounts.
|
Hi
Sorry for the delay in replying; locking users into specific directories is only a part of the whole "secure the server" plan we have 
|
|
|
All times are GMT -5. The time now is 01:27 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
|
|