Operating System - HP-UX
1753835 Members
8552 Online
108806 Solutions
New Discussion юеВ

With sudo not able to execute cd command

 
SOLVED
Go to solution
Rajendra prasad NVR
Frequent Advisor

With sudo not able to execute cd command

Please can any one aware of sudo is not working to execute the cd command

[tux:/orahome]cd dba
sh: dba: Permission denied.
[tux:/orahome]sudo cd dba

When execute this are ordinary user not going because that directory is for root only.
But when i execute cd with sudo it is not giving any error but not going to that directory.

I have configured sudo to execute me as a root with sudo. All other commands are working except cd command.
6 REPLIES 6
Dennis Handly
Acclaimed Contributor
Solution

Re: With sudo not able to execute cd command

>But when i execute cd with sudo it is not giving any error but not going to that directory.

You can't usefully do this command. After it changes to that directory, it then exits.
charlie_bulosan
Frequent Advisor

Re: With sudo not able to execute cd command


Hi,

You should include -

Host_Alias =

# User alias specification
User_Alias =

Cmnd_Alias CD = /usr/bin/cd


DPADMIN CELLMPKG = (OP) NOPASSWD: CD



Regards,
Charlie
Yashwant
Valued Contributor

Re: With sudo not able to execute cd command

if you have already configured sudo then add one more line in /usr/local/etc/sudoers

Cmnd_Alias CD = /usr/bin/cd

Torsten.
Acclaimed Contributor

Re: With sudo not able to execute cd command

See also

https://community.hpe.com/t5/System-Administration/bd-p/itrc-156#.WNOeyk27odk

and

http://docs.hp.com/en/B3921-60631/cd.1.html


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Rajendra prasad NVR
Frequent Advisor

Re: With sudo not able to execute cd command

Thank you for those who had replied for this.

Though i add the line visudo file it not working.

I hope cd will not work
Rajendra prasad NVR
Frequent Advisor

Re: With sudo not able to execute cd command

Line here means above lines which advice to add in visudo file.