Sponsored Content
Operating Systems HP-UX Problem using sudo with NOPASSWD Post 302970722 by aigini82 on Monday 11th of April 2016 10:26:07 AM
Old 04-11-2016
Problem using sudo with NOPASSWD

I need to configure access for a user in an HP-UX to :

1) use certain commands and
2) login as another user as a sudo.

These have to be done WITHOUT the user needing to enter a password.

However, after I enter the lines using visudo, there is a prompt for a password when the user executes those 2 commands.

This is the line I added in visudo :

Code:
etigers   ALL = NOPASSWD: /usr/sbin/sudo su - userX, /path/to/command/to/execute

However, initially before this line was added, there were 2 other lines above it, without the NOPASSWD option. Could it be that these 2 lines were overriding this line?

Also, in the visudo file there was no !#/bin/bash at the top of the file.

Or is it that for users first time using sudo, there will be a prompt for password?

Is there a need to restart visudo service? If so, how? What command? I tried using service visudo restart but it says 'service' no such command.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with sudo su and .sh script

here is my script: #!/bin/sh cd /Users/a echo "what is the name of the file u want?" read var1 var1=$var1... (1 Reply)
Discussion started by: cleansing_flame
1 Replies

2. UNIX for Advanced & Expert Users

Sudo command problem

Hi All, I am tring to redirect mails comming to my user id to a script. In other word trigger a script when a mail comes to my user id. Actually , Admin team has done all this to me previously. in my script i am doing like /usr/local/bin/sudo -u parbrxs /export/home/parbrxs/bin/parbrxs.sh... (4 Replies)
Discussion started by: mindtee_abhi
4 Replies

3. UNIX for Advanced & Expert Users

Switch user :NOPASSWD setting

Hi All, I want trigger a script "abhishektest.sh "whenever a mail come to a user say "abhishek" in my unix server. I dont have root permission. So, for doing this i added abhishek : "|/export/abhishek/bin/wr_test.sh in /etc/mail/aliases in wr_test file : i need to put this line, as i... (2 Replies)
Discussion started by: mindtee_abhi
2 Replies

4. Shell Programming and Scripting

shell script problem , sudo mount command

cat test.sh sudo mount -t vfat /dev/sda7 /media/Ddrive If i double click the test.sh file and select run in terminal then the terminal prompts for password. How can i avoid typing password? Or if i double click test.sh file and select run then nothing happens. What i'm trying "Double... (3 Replies)
Discussion started by: cola
3 Replies

5. Linux

Sudo Problem?

Hi I wanted to add a group using 1 id which is not root but has some sudo privileges. test@test>sudo -l gives this (root) NOPASSWD: /usr/bin/passwd, /usr/sbin/useradd, /usr/sbin/usermod, /usr/sbin/userdel, /usr/bin/tee, /usr/bin/grep, /bin/grep, /usr/bin/chmod, /bin/chmod, /usr/bin/echo,... (1 Reply)
Discussion started by: datkan
1 Replies

6. Solaris

Problem with password expire and sudo.

Hi, I have a small problem that I need to address regarding the password expiration for a number of different oracle accounts. Currently I have the MAXWEEKS set to 12 in the /etc/default/passwd file for all accounts. I also have sudo installed on the server and users access the oracle accounts... (2 Replies)
Discussion started by: sparcman
2 Replies

7. UNIX for Dummies Questions & Answers

Problem with Sudo inside a here document

Have a sudo statement inside of a here document. It prompts me for a password, but doesnt wait for me to enter my password. Is there a way I can use the command without sudo or anyway that I can enter the password correctly? Eg : while read remotehost do ssh -t $2@$remotehost ... (0 Replies)
Discussion started by: mnanavati
0 Replies

8. UNIX for Advanced & Expert Users

sudo wildcards problem: for every argument a *-wildcard? Better solution?

Hi I allow the user tommy to run this command as root sudoCommand: /app/appname/connectors/*/*/current/bin/*With "sudo -l" he sees the sudoers, but is unable to execute. $ sudo /app/appname/connectors/zur/namename/current/bin/othername agentsvc --i --u root --sn 1m7command Sorry, user... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

9. Shell Programming and Scripting

Problem connect to a different server then do sudo login and finally run some scripts and get result

I have to write a shell script in my current linux server and I have to connect to a different server then do sudo login and finally run some scripts residing in a particular directory and get results back. I am starting to write my shell script as below but after I do ssh login it prompts for... (2 Replies)
Discussion started by: Devesh5683
2 Replies

10. UNIX and Linux Applications

LDAP - sudoers and the nopasswd flag - How can i set some commands for wheelgroup without password?

Hello :) we use LDAP with sudoers about 4 years. Works fine. But we have one problem with members of the admingroup (wheel). This users can do every command with sudo and with there privat password. But when they also are member to another special group, like sysadmin: Sysadmin is allowed to... (0 Replies)
Discussion started by: darktux
0 Replies
csp_helper(1)							  USER COMMANDS 						     csp_helper(1)

  NAME
      csp_helper - A collection of caspar helper scripts

  SYNOPSIS
      csp_install dir (directory) file (file)

      csp_mkdircp dir (directory) file (file)

      csp_scp_keep_mode h ([user@]host) dir (directory) file (file)

      csp_sucp h ([user@]host) dir (directory) file (file)

  DESCRIPTION
      The  scripts  csp_install,  csp_mkdircp,	csp_scp_keep_mode  and csp_sucp are helpers for caspar(7). These scripts typically are not invoked
      directly, but via a Makefile which uses caspar. See the notes on	csp_PUSH  in  caspar(7)  for  information  on  how  to	link  csp_install,
      csp_scp_keep_mode and csp_sucp to caspar.

  install DESCRIPTION
      csp_install creates the required directory (if needed) and installs the file, preserving timestamps. It uses install(1).

  install EXAMPLES
       csp_INSTALL_OPTIONS='--owner=www-data --group=www-data' 
	csp_INSTALL_MODE=ugo=r 
	csp_install /srv/www index.html

       csp_INSTALL_MODE=u=rwx,go= csp_install /usr/local/sbin mkpasswd

  install ENVIRONMENT
      csp_install honors csp_INSTALL_OPTIONS and csp_INSTALL_MODE (default is u=rw,go=r).

  mkdircp DESCRIPTION
      csp_mkdircp calls mkdir(1) and cp(1).

  scp_keep_mode DESCRIPTION
      csp_scp_keep_mode  uses  ssh to copy a file to a remote host, keeping its file permission mode. The trick used is a combination of mktemp(1)
      and mv(1).  Useful if you'd like to be sure a file gets installed e.g. group writable, without fiddling with permission bits on  the  remote
      host.

  scp_keep_mode EXAMPLE
	chmod g+w rc
	csp_scp_keep_mode root@gandalf /etc/uruk rc

  scp_keep_mode ENVIRONMENT
      csp_scp_keep_mode honors csp_SSH ("ssh" by default).

  sucp DESCRIPTION
      csp_sucp calls cat(1) from within sudo(1) from within ssh(1). This allows one to copy files to accounts on hosts one can only reach by call-
      ing sudo on the ssh-reachable remote host.

      Typically, one wants to install a root-owned file, but one does not want to allow access to the root-account directly  from  ssh.  Typically
      sudo is used as an extra line of defense.

  sucp EXAMPLES
      Some examples:

	csp_sucp rms@bilbo /etc fstab

	csp_sucp monty-python commit/ trailer.txt

  sucp BUGS
      If  NOPASSWD  is	not  set in the sudoers(5) file, and one's timestamp is expired, csp_sucp will forward the sudo password prompt. The given
      password will be echoed on the console!

  AUTHOR
      Joost van Baal-Ili

  SEE ALSO
      caspar(7) The caspar homepage is at http://mdcc.cx/caspar/ .

  csp_helper 20120514						      14 mai 2012						       csp_helper(1)
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy