Operating System - HP-UX
1751735 Members
5872 Online
108781 Solutions
New Discussion юеВ

Re: Is possible to run copy_boot_tape with sudo?

 
SOLVED
Go to solution
Manuel Plaza
Regular Advisor

Is possible to run copy_boot_tape with sudo?

Hi all,

Is possible to run copy_boot_tape with sudo? We have tried it but it's produced the following error:

host> sudo copy_boot_tape -p /dev/datn -d sm-5-sii-11002
Password:
/opt/ignite/bin/copy_boot_tape: awk: Execute permission denied.
/opt/ignite/bin/copy_boot_tape[13]: == 1 : Syntax error
Putting the boot area on tape.
/opt/ignite/bin/copy_boot_tape[6]: dd: Execute permission denied.
Tape may be write protected.

Thanks in advance.
5 REPLIES 5
nijokj
Trusted Contributor

Re: Is possible to run copy_boot_tape with sudo?

yes ,you can run this as root.
Can you post sudo -l command output.
Manuel Plaza
Regular Advisor

Re: Is possible to run copy_boot_tape with sudo?

The sudo -l output:

> sudo -l
Password:
User plaza may run the following commands on this host:
(root) NOEXEC: /opt/ignite/bin/copy_boot_tape, /usr/bin/dd, /sbin/awk
Matti_Kurkela
Honored Contributor
Solution

Re: Is possible to run copy_boot_tape with sudo?

>(root) NOEXEC: /opt/ignite/bin/copy_boot_tape, /usr/bin/dd, /sbin/awk

NOEXEC means /opt/ignite/bin will be run in such a way that execv() family of system calls will be disabled - in other words, the copy_boot_tape process will run, but it cannot run any sub-processes.

Since copy_boot_tape is a script, the ability to run sub-processes is rather essential to it. If you use NOEXEC with a script, it's very likely the script won't work when run with sudo.

The NOEXEC restriction is intended more for interactive programs that contain shell escape functionality, like "more" or "vi". For example, you might grant the user permission to view a particular file that must normally be accessible by root only:

plaza somehost=(root) NOEXEC: /usr/bin/more /etc/opt/ipf/ipf.conf

If NOEXEC is not used here, the user can run the allowed "sudo more /etc/opt/ipf/ipf.conf", then type "!/usr/bin/sh" while the more command is running to get a root shell.

Adding /usr/bin/dd and /sbin/awk to the sudoers definition line won't allow copy_boot_tape to run them - it just allows the user to run dd or awk on any file or device on the system, which probably isn't what you want.

MK
MK
Manuel Plaza
Regular Advisor

Re: Is possible to run copy_boot_tape with sudo?

The answer of Matti has solved the problem
nijokj
Trusted Contributor

Re: Is possible to run copy_boot_tape with sudo?

remove the NOEXEC from the sudoers file will allow you to run this script with out any problem.