Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sudo reads password from a .cfg file Post 302956018 by dellanicholson on Thursday 24th of September 2015 05:34:05 PM
Old 09-24-2015
Sudo reads password from a .cfg file

cleanwork /saswork removes sas orphanded processes in the saswork directory. Subdirectories under sasem are sas94, sas92 and sasworks .

I am getting the following error messages:
1.
'/usr/bin/sudo -S apt-get update <~/opt/SiM/pos/ps/db_auth.cfg /sasem/sas92/sashome/sasfoundation/9.2/utilities/bin/cleanwork /sasworks'

line 69 '/usr/bin/sudo -S apt-get update <~/opt/SiM/pos/db_auth.cfg /sasem/sas92/sashome/sasfoundation/9.2/utilities/bin/cleanwork /sasworks: A file or directory in path does not exist

2.
'/usr/bin/sudo -S apt-get update <~/opt/SiM/pos/db_auth.cfg /sasem/sas94/sashome/sasfoundation/9.4/utilities/bin/cleanwork /sasworks'


line 76 '/usr/bin/sudo -S apt-get update <~/opt/SiM/pos/db_auth.cfg /sasem/sas94/sashome/sasfoundation/9.4/utilities/bin/cleanwork /sasworks: A file or directory in path does not exist


3.
-S apt-get update is not reading in the password from the db_auth.cfg file.

4.
How the sudo -S apt-get update <~/opt/SiM/pos/db_auth.cfg syntax works is when the sudo command prompts for a password, the password is read from db_auth.cfg.

5.
db_auth.cfg contents are as following (encrypt the password) :
DB_PASSWD="Swxftyi"
DB_PASSWORD=$(eval echo ${DB_PASSWD} | base64


6.
Code:
db_auth.cfg
DB_PASSWD="Swxftyi"
DB_PASSWORD=$(eval echo ${DB_PASSWD} | base64

7.
Code:
function cleanwork 
{
 set -x
    '/usr/bin/sudo  -S apt-get update <~/opt/SiM/pos/db_auth.cfg     /sasem/sas92/sashome/sasfoundation/9.2/utilities/bin/cleanwork /sasworks'
set +x
}

function cleanwork94
{
 set -x
    '/usr/bin/sudo  -S apt-get update <~/opt/SiM/pos/db_auth.cfg     /sasem/sas94/sashome/sasfoundation/9.4/utilities/bin/cleanwork  /sasworks'
set +x
}

./cleanwork

./cleanwork94

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

verify sudo password

edited and removed (0 Replies)
Discussion started by: mdpalow
0 Replies

2. Shell Programming and Scripting

sudo command with password

Hello everybody, Say I forgot my root password (shit happens, no?) and I'd like to brutally try 100 possibilities to delete a file using sudo. How can I make a script that tries all the passwords? The following doesn't work. Do you have a clue? foo:~$ cat test sudo rm dummy <<< 'password' echo... (1 Reply)
Discussion started by: chebarbudo
1 Replies

3. AIX

Sudo ask for password

Hello I have a partition with Aix 5.3 and I install sudo I put the commands that I want to use x user and I put the option that donkask for password. But when I run with this user and I try to run that commands. ask me for a password. I put this line for no ask for password with that... (2 Replies)
Discussion started by: lo-lp-kl
2 Replies

4. UNIX for Dummies Questions & Answers

Difference between buffered disk reads and cached reads?

I was analyzing the Disk read using hdparm utility. This is what i got as a result. # hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 108 MB in 3.04 seconds = 35.51 MB/sec # hdparm -T /dev/sda /dev/sda: Timing cached reads: 3496 MB in 1.99 seconds = 1756.56 MB/sec... (1 Reply)
Discussion started by: pinga123
1 Replies

5. Shell Programming and Scripting

password in sudo script

salmo allikm warhmat allah wabrakato i want to do script with sudo like sudo su and want to put password in the script not get from user because i to made it startup when booting and i don't know how put in script for sudo thanks (5 Replies)
Discussion started by: pua06
5 Replies

6. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption... (9 Replies)
Discussion started by: fluoborate
9 Replies

7. UNIX for Advanced & Expert Users

problem creating pxelinux.cfg default file

Hi All, I was trying to create pxelinux.cfg/default file in a script that I use for creating backup of bootimage. cat 2>${BACKUB_BOOTIMAGE_ERRINFO} >${pxelinux_cfg_file} <<EOF prompt 1 timeout 0 display boot.msg label restore kernel kernel append root=/dev/nfs... (0 Replies)
Discussion started by: Pkumar Sachin
0 Replies

8. Red Hat

Sudo + Nohup = no password?

Little confused here When i go to run sudo nohup ./script.ksh & I dont get asked for a password. It starts a process ID, I can see it when i do a ps -ef | grep script. But I dont get an output file from my script, so its not doing anything. What gives? does it have to do the "&" ? ... (4 Replies)
Discussion started by: nitrobass24
4 Replies

9. Solaris

Sudo without password Solaris 11.2

Hi guys, I have the strangest issue... might be a huge oversight.. who knows!! :) I am trying to configure a user to use sudo with no password, here is my sudoers configuration file root@isha:~# egrep -v "^$|^#" /etc/sudoers root ALL=(ALL) ALL %wheel ALL=(ALL) NOPASSWD: ALL... (5 Replies)
Discussion started by: akame
5 Replies

10. Shell Programming and Scripting

Sudo password in shell file

Hi all, I have a script like this, where i am trying to login into oracle db via ssh and do a account unlock. #!/bin/sh ip=$1 os_user=$2 key=$3 ou_user=$4 ou_pass=$5 unlock_user=$6 ssh -i $key $os_user@$ip sudo -u $ou_user -p $ou_pass -- i am getting error here...its not taking... (16 Replies)
Discussion started by: onenessboy
16 Replies
APT-CUDF-GET(8) 						    DOSE Tools							   APT-CUDF-GET(8)

NAME
apt-cudf-get - wrapper for calling apt-get with external solvers SYNOPSIS
apt-cudf-get [arguments] DESCRIPTION
apt-cudf-get is a wrapper that allows to invoke apt-get with external solvers while ignoring apt's pinning. All options are passed on to apt-get. Normally, apt uses so-called pinning to select a candidate version of a package in case there are several versions available. This also holds when calling apt-get with external solvers. However, when it is not possible to find a solution under this constraint, it may be useful to relax pinning and to allow the external solver to choose among all available versions of packages in order to satisfy dependencies, not only those that are selected by the pinning. This is precisely what apt-cudf-get does. Note that, when using an external solver, the proposed solution may contain any available version of the packages that are given as arguments to install on the command line without specifying a version qualifier. For example apt-cudf-get --solver aspcud install ocaml may propose to install any available version of ocaml, while apt-cudf-get --solver aspcud install ocaml=4.01.0 will only propose to install ocaml in version 4.01.0 AUTHOR
Pietro Abate and Roberto Di Cosmo BUGS
Not all types of arguements to apt are correctly treated by this wrapper, in particular not the +pkg and -pkg shorthands for installation and removal requests. SEE ALSO
apt-get(8), apt-cudf(1), apt-cudf.conf(5), update-cudf-solvers(8), README.cudf-solvers <file:///usr/share/doc/apt-cudf/README.cudf-solvers>, README.Debian <file:///usr/share/doc/apt-cudf/README.Debian> dose3 3.0.2 2012-06-25 APT-CUDF-GET(8)
All times are GMT -4. The time now is 12:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy