hi everyone
i'm running script in c-shell and i want this script to connect to admin account in order to run other script in k-shell. after that i want the script to be severed from the admin account and to continue with the regular commands
example:
my script call cs-customers
echo"starting to search for customers files"
login:admin
passwd:
ksh cs-search
#disconnect from the admin account
if test -s b.log
........
fi
the problem is that the script stop because he need the passwd of the admin
how can i do this or fix such a script that he won't stop ?
of course the script in c-shell and the script in k-shell are running in different
directories
thanks for the quick response
i didn't get the idea of sudo should i build these as different file ?
does someone have any other solution ?
please help
best regards
Well, if you want to execute everythig in the same server, I would chose sudo.
In this case, youo should install the tool and configure it for your needs using "visudo"
You would add a line like this:
user ALL=NOPASSWD:/path/to/cs-customers
"user" is the user who executes the initial script, and "/path/to/cs-customers" is what you want this user to execute as root. The script then would be:
Finally, If the initial script is in one server and the second in another, you should consider using ssh with digital certificates for authentication so that you won't need to enter root's password. Though you could automate a telnet session. There are a couple of threads about this in this forum.
hi everyone
i try to do something like this
i go to the admin account (root) and did
id
giving me
uid=0(root) gid=1(other)
now in the first script cs-customers i did something like this
echo"starting to search for customers files"
login:root
password:
#id
uid=0(root) gid=1(other)
ksh cs-search
#disconnect from the admin account
if test -s b.log
........
fi
question 1 .is it true to write like this
2. my goal is not to touch any of the .login or /etc/host file
i just want to connect to root because if the script and then disconnect from it . i want to connect to root without passwd only when i running the cs-customers . is it correct what i wrote???
thanks all for quick response
hi
first according to your reaction i'm hope i didn't cause any harm
please currect me if i'm wrong i didn't change anything in any system files or something however let me explain again
i'm working in the same machine in this machine i have several users and
directories some of them are c-shell and some k-shell
i have problem because when i'm running script in c-shell cs-customers) it start to
perform object in cobol which going through several directories and
reading files . the problem is :
while i'm running the script above (cs-customers) he cannont read the files because i need to change their premissions.problem i need to connect to root
account (in the same machine) and change premissins of those files.
from my point of view i realy do'nt care if i need to run 2 different script bacause i still in the same problem ,if i have script i need to su him to root account for changing mod of files
any solutions
i think that might be here easy solution because i'm working abount one machine all the time
I have a good friend leaving my place of employment. He's an old greybeard. His first job was sorting punch cards. I'm serious.
I'm looking for suggestions on a short shell script to write in his card to say good bye.
Please be creative and obfusticating!
have fun with it.
... (4 Replies)
I am planning to choose my career as Unix/Linux Admin or a DBA. But I have come to know from forums and few admins like the job will be 24/7. I have few questions on that.
Can we get "DAY" shifts in any one of the admin Job ?
Can't we have shift timings in any company ?
Eventhough the... (7 Replies)
Can anyone create or give me a script that I can use to email a user automatically when I kill one of their processes?
Or
Can you give me a script to allow me to email a user (entering email manually) when a process is killed? Like showing what the PID was and a reason the admin killed it? Is... (2 Replies)
I'm currently a Windows admin and have wanted to jump ship to the *nix side for a while now. I've been studying both through an lpic level 1 manual as I have time (focusing on debian), and a solaris 10 cert book. The problem is I only have a handful of hours a week to study, and my current job... (3 Replies)
Hi all,
I encountered a problem where my script stops running the remaining checks after becoming an admin that is written within the script.
For example:
=========================================
#!/bin/sh
check 1 # Runs successfully
check 2 # Runs successfully
/com/bin/admin #... (1 Reply)
I have a sunfire V240 but nobody seems to know the root password. I can get into ALOM but not console mode. Is there a hack or something that cn get me back into this system lo reload it? (5 Replies)
Hi All,
If I want to have two user accounts from the same grop in UNIX Solaries. However, I want one of them to be used only for FTP while the other for TELNET. Can anybody tell me how to do that?
Best Regards (13 Replies)