The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Change directory command (cd) c00kie88 Shell Programming and Scripting 21 07-11-2008 10:01 AM
Change Directory vskr72 UNIX for Dummies Questions & Answers 2 05-26-2008 02:50 AM
Change to a new working directory... jagannatha UNIX for Dummies Questions & Answers 5 06-29-2005 10:38 PM
change directory mkan Shell Programming and Scripting 2 02-26-2005 04:55 PM
change directory vadivel Shell Programming and Scripting 1 06-10-2002 10:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-22-2002
oscarr oscarr is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 2
Change directory command (cd)

I want to limit the directories that a user can
access. When this users logs in, I do not want
them to cd to any directory but those in their
$HOME. In other words:

login:

pwd:
/home/user

cd / -- user tries to cd to root directory.

pwd

/home/user -- user is still in home directory

but can cd to subdirectories in their $HOME

cd /home/user/dir1

pwd

/home/user/dir1

Any help would be greatly appreciated.

Oscarr.
  #2 (permalink)  
Old 08-22-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
I don't know the answer...but I do know that this can be set up for ftp accounts, maybe the same logic can be applied locally? Anyone know how this is set up with ftp?
  #3 (permalink)  
Old 08-22-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
It can get very complicated and messy very quickly, but it can be done with chroot. I believe it has been laid out a few time in these forums before - try searching for "chroot" or "chroot user"...
  #4 (permalink)  
Old 08-23-2002
asifraj's Avatar
asifraj asifraj is offline
Registered User
  
 

Join Date: Aug 2002
Location: India
Posts: 48
you can change the permissions of the directories /root and whatever directories you want to by the command chmod. but if you do not allow the user to access /lib and /usr directories, then it could be problematic as they contain the most common libraries and commands to be used by most common program. say if he is doing C programming, then removing the permissions of /lib directory will stop him from doing any kind of programmig.
  #5 (permalink)  
Old 08-23-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Changing the permissions on system directories, (especially /) will screw up your system very fast.

Many unix commands depend on system directories being accessable. Unix is not intended to have system directories locked away from users.

The only time that I have done this was to establish a super limited account for communications engineers to use to prove that our system was accessable. They could log in and run the echo command. And they could ise "exit" to log off. And that was it. If you want an account that tight, you can use chroot. But it won't be able to do much else.

Also, whenever people want something like this, they seem to focus on the cd command.

Doing something like:
cd /etc
cat passwd

is not very much different from:
cat /etc/passwd
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0