|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Restrict command for an user ?
Hi everyone !
I got "viewer" and "root" user on a *nix computer. When i log in using "viewer" I only can use "df" command. When I try another command like "ls" it say : -bash: ls: command not found I checked permission of "/bin/ls" file, it has excute permission for everyone. Inside home directory of "viewer" there's only a directory "bin" and within it only the "df" file. Can anyone tell me how to restrict command for an user like that ? Last edited by camus; 12-30-2009 at 02:18 AM.. |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
You might want to check if this is a chroot environment (it looks like one) or if that user has a restricted shell, which can be checked in /etc/passwd (look for the shell entry).
To make sure, try to cd into another directory or try to call ls by it's full path /bin/ls and check what error you might get. If this viewer user should be enhanced by additional commands, you might want to copy those binaries he should be able to use into that ./bin directory inside his home directory. Some tools require libraries to work correctly, which you can check with the tool ldd. You might need to copy it there too to an adequate path so it can be found by the binary. |
|
#3
|
|||
|
|||
|
This could be due to a change in the value of $PATH. Code:
$ which ls /bin/ls $ PATH=/sbin $ ls /bin/ls -bash: ls: command not found $ /bin/ls /bin/ls /bin/ls If it's a PATH issue, you should still be able to run the command if you invoke it by specifying the path to the command with either an absolute or relative pathname (must contain a forward slash). Last edited by alister; 12-30-2009 at 01:39 PM.. |
|
#4
|
|||
|
|||
|
Quote:
@alister : I checked the $PATH and yes it is /home/viewer/bin. And using the full path of other command has no problem. But I still have one question why I can use cd and echo command ( not full path ) while they're not in /home/viewer/bin . Because they're Built-in command ? Thanks for help !! Camus |
|
#5
|
|||
|
|||
|
Quote:
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New user and restrict path | lo-lp-kl | AIX | 1 | 01-18-2009 05:54 AM |
| How to restrict the perticular command to user | murthy76 | Solaris | 3 | 11-26-2008 06:27 PM |
| restrict the user not to key in more than 50 chars | injeti | Shell Programming and Scripting | 18 | 08-16-2008 11:06 AM |
| restrict a user to certain command | vikas027 | Solaris | 1 | 03-07-2008 08:52 AM |
| need to restrict user to his home dir | lidram | Solaris | 5 | 02-06-2008 10:03 AM |