Sponsored Content
Top Forums Shell Programming and Scripting Shellscript not executing further after sudo over a user Post 302773513 by adityam on Thursday 28th of February 2013 06:03:41 AM
Old 02-28-2013
Shellscript not executing further after sudo over a user

Hi,

I am writing a switch case statement and one of the option contains sudo to a particular user and then perform some steps after that but my script is unable to proceed with further execution after doing sudo over the user. Could you please suggest an workaround for this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shellscript to Sudo other account

Hi, I have to write a shell script to sudo other account. Foreg, i am working in account ramdev1, i have a sudo access where through shell script i need to sudo another account ramdev2 and read a file "ram.inc" get those data and save it in a .txt file and return it? Since i am new to... (21 Replies)
Discussion started by: sachin.tendulka
21 Replies

2. UNIX for Dummies Questions & Answers

scp with a sudo user

Morning guys, I'm hoping you can advise me as to whether or not the following is possible. Is there a way of firing off an scp command with a sudo user as the user? e.g. I am logged onto server1 as smith, but want to pull files from server2 that I can only read as sudo jones. In my mind it... (3 Replies)
Discussion started by: dlam
3 Replies

3. Linux

Sudo user vs RBAC

Hi all, What the difference between the sudo users & RBAC when the talk of effects after doing the above comes??? any differences between them ,kindly list ?? (1 Reply)
Discussion started by: saurabh84g
1 Replies

4. AIX

sudo user access

I have installed sudo on AIX 6100-04 and want to know how do I set it up for a user to be able to run only some commands? I want to give the user the rights to only cd to certain directories and run the ls command to name a few? Are there any issues with running sudo when the user is forced to... (2 Replies)
Discussion started by: daveisme
2 Replies

5. Shell Programming and Scripting

how to write a shellscript to send a mail alert to the website user based on license expiration time

hi, i am very much new to shell scripting i have a requirement that i have to develop a License Renewal Alert system that has to give a alert mail to the users before 30days of user account expiration, by checking expiration date of the user with the data base, this system will... (0 Replies)
Discussion started by: deepu_Shscripts
0 Replies

6. UNIX for Dummies Questions & Answers

sudo user

I am trying to run a command from different user on my server. However when i execute the command it asks for password can you please help. when i use this command to switch user no password is required 1) sudo su - bilbtf42 when i use 2) sudo su - bilbtf42 cp file1 direcotry1/file1 ... (3 Replies)
Discussion started by: blackeyed
3 Replies

7. UNIX for Dummies Questions & Answers

sudo su - USER ??? How to??

Hi folks, Here is my question of the day 8-) I have to provide the ability to sudo su - orapd2 & sudo su - pd2adm for the following people User A, B, C, D which all of them are part of the group staff. orapd2 and pd2adm are also users. Users A, B, C, D should not type the password for... (2 Replies)
Discussion started by: 300zxmuro
2 Replies

8. Shell Programming and Scripting

sudo su - user not working

Hi All, I need your expertise to solve my problem, my account has permission to make sudo and su but when I try to switch user in a shell, it does not work with following message: "Sorry, user jmbeltra is not allowed to execute '/usr/bin/su -c echo HELLO THERE - oracle' as root on dbbr1k01" I... (4 Replies)
Discussion started by: Axtel
4 Replies

9. AIX

Sudo to other user

Hello All, I am trying to grant sudo privileges to a set of users (say tom and jerry) to sudo to another set of users (jim, harry). This is because we don't want to disclose the password of jim and harry. I did defined the user_alias and runas alias. %wms ALL = (USR) /usr/bin/su -, where wms... (7 Replies)
Discussion started by: ibmtech
7 Replies

10. Shell Programming and Scripting

Executing bash file with sudo for the second time, leads to permission denied, for some commands

I have a script that checks if the script has been ran with sudo. If the script is not ran as sudo, the current script is being executed with exec sudo bash. You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies
0STORE-SECURE-ADD(1)													      0STORE-SECURE-ADD(1)

NAME
0store-secure-add -- add an implementation to the system cache SYNOPSIS
0store-secure-add DIGEST DESCRIPTION
This command imports the current directory into the system-wide shared Zero Install cache, as /var/cache/0install.net/implementa- tions/DIGEST. This allows a program downloaded by one user to be shared with other users. The current directory must contain a file called '.manifest' listing all the files to be added (in the format required by DIGEST), and this file must have the given digest. If not, the import is refused. Therefore, it is only possible to add a directory to the cache if its name matches its contents. It is intended that it be safe to grant untrusted users permission to call this command with elevated privileges. To set this up, see below. SETTING UP SHARING
To enable sharing, the system administrator should follow these steps: Create a new system user to own the cache: adduser --system zeroinst Create the shared directory, owned by this new user: mkdir /var/cache/0install.net chown zeroinst /var/cache/0install.net Use visudo(8) to add these lines to /etc/sudoers: Defaults>zeroinst env_reset,always_set_home ALL ALL=(zeroinst) NOPASSWD: /usr/bin/0store-secure-add Create a script called 0store-secure-add-helper in PATH to call it. This script must be executable and contain these two lines: #!/bin/sh exec sudo -S -u zeroinst /usr/bin/0store-secure-add "$@" < /dev/null The other Zero Install programs will call this helper script automatically. FILES
/var/cache/0install.net/implementations System-wide Zero Install cache. LICENSE
Copyright (C) 2009 Thomas Leonard. You may redistribute copies of this program under the terms of the GNU Lesser General Public License. BUGS
This program is EXPERIMENTAL. It has not been audited. Do not use it yet in security-critial environments. The env_reset line in sudoers may not be required. sudo(1) seems to do it automatically. If sudo let us check whether we could call a command then we could switch to using it automatically, instead of needing to add the helper script. Currently, sudo delays for one second and writes to auth.log if we try to use this system when it hasn't been set up. Please report bugs to the developer mailing list: http://0install.net/support.html AUTHOR
Zero Install was created by Thomas Leonard. SEE ALSO
0store(1) The Zero Install web-site: http://0install.net Thomas Leonard 2010 0STORE-SECURE-ADD(1)
All times are GMT -4. The time now is 03:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy