Im finding trouble writing a script that runs from account A, switches user to B (on same server), performs a few jobs at B, and switches back to A. I want the password for B hardcoded in the script so that it doesnt prompt for one. Someone please help.
sameet_aset
0
Newbie Poster
Recommended Answers
Jump to PostHardcoded passwords are a security risk - FWIW.
if you are root you can use sudo or su by default. Otherwise use a here document:
su username <<! password /bin/ksh command command command exit !
su may also give you the wrong shell, which is why …
All 3 Replies
jim mcnamara
19
Junior Poster
sameet_aset
0
Newbie Poster
alc6379
120
Cookie... That's it
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.