How to run command with another user privilege in linux and unix


You can set sudo permissions to run command with  another  user privilege. Please  follow these steps to run command  on sudo.

Step 1:  Check  if sudo package installed. 

Red Hat:

# rpm -qa|grep sudo
sudo-1.8.6p3-15.el6.x86_64

HP-UX:

#swlist -l product|grep -i sudo
sudo 1.8.10p3 sudo

Solaris:

#pkginfo  |grep -i sudo

Step 2: Check visudo  path and  run "visudo" command .

#/usr/sbin/visudo

Step 3: Add  this line  for any spesific  command.

For example;

username ALL=(oracle) NOPASSWD: /usr/bin/crontab

 

Tagged In:

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me