Operating System - HP-UX
1827807 Members
2998 Online
109969 Solutions
New Discussion

Re: how to get the sudo file back.

 
Ravi22
Occasional Contributor

how to get the sudo file back.

HI,

Unfotunetely /usr/local/bin/sudo ,sudoedit permissions has changed. Due to this we are unable to get the "sudo" permissions. we have the 3 weeks o/s tape backup. we are tried to restore the file, same location. but it throughing the error "permissions denied".

I request to all , please give the solution , regarding this issue.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: how to get the sudo file back.

What are the current permissions and ownership of the two files? It has to have the SUID bit set and be owned by root.
If you restore it off of the tape as root, that should have fixed it.
Unless you use pax(1) without -p e, that refuses to restore those bits.
Ravi22
Occasional Contributor

Re: how to get the sudo file back.

The two files permissions is 777,777.Owned by root.

we restore at first time it is overwrite the same location. instated of sudo file it is usr(directort)inside local (directory) inside sudo file is prasented. This permissions also 777. And it is prasented in the binary format.we are able to see through strings sudo the out put is showing in zeros only.
Dennis Handly
Acclaimed Contributor

Re: how to get the sudo file back.

>The two files permissions is 777,777, owned by root.

This is NOT good enough. They should not be writable at all and they need to have the SUID bit set:
chmod a-w,u+s

What tool(s) are you using to backup and restore?

What does this show:
ll -d /usr /usr/local /usr/local/bin /usr/local/bin/sudo /usr/local/bin/sudoedit