|
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
|
|||
|
|||
|
why sudo doesn't work?
Code:
[test@manager ~]$ sudo -l
User test may run the following commands on this host:
(ALL) ALL
[test@manager ~]$ sudo ls /root
anaconda-ks.cfg Desktop install.log.syslog l.of page.html VTune
cpi ex intel mpd.hosts #te.c# workspace
cpi.c ex1.c libxrdisk_1_BPET46J_02_09_14.so.1.0.0 my_page te.c x
deli install.log list_disk_space_used_by_users.sh mysqlaccess.log test xCATdb-dump
[test@manager ~]$ sudo useradd myuser
sudo: useradd: command not found
[test@manager ~]$command "sudo ls" works, but why "sudo useradd myuser" doesn't work?? |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
Probably because useradd isn't in your path and has to be called using the full path (eg /usr/sbin/useradd). The reason simply is that sudo doesn't change the environment in any way, it just performs an ID change.
|
|
#3
|
|||
|
|||
|
You are correct. But if I want to use command sudo cd /root , how do I use the full path of command cd? Code:
[test@manager proc]$ whereis cd cd: /usr/share/man/man1/cd.1.gz /usr/share/man/man1p/cd.1p.gz /usr/share/man/mann/cd.n.gz I cann't know the full path of cd ![]() Thanks! |
|
#4
|
||||
|
||||
|
That's because cd isn't a program, but a shell-builtin. Always. It wouldn't be useful as a standalone utility, as it can't change the working directory of any other program.
|
|
#5
|
|||
|
|||
|
Just edit .profile and find your path and add /sbin , relaunch a shell and try it again.
|
| 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 |
| Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:" | Chloe123 | UNIX for Dummies Questions & Answers | 1 | 12-21-2009 04:09 PM |
| sudo and su - | melanie_pfefer | UNIX for Dummies Questions & Answers | 1 | 03-10-2008 01:23 PM |
| sudo, or not sudo: that is the question | Linux Bot | UNIX and Linux RSS News | 1 | 02-07-2008 12:40 PM |
| About sudo | ust | UNIX for Advanced & Expert Users | 1 | 07-25-2007 06:51 AM |
| Script doesn't work, but commands inside work | cheongww | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 09:52 PM |