I'm trying to automate a standard activity on a system I do not have root access on. The administrator of the systems have given me authority to run
sudo su - 'user' command, and only that command. I can not add a
-c argument or
sudo will fail.
My script will have to start with my permissions, and midway through change to running with the user's permissions. I'm trying to figure out if there is a way to make a script do this for me in a single command?
Before anyone asks, trying to get my
visudo permissions extended is quite difficult. While I could probably
su using the password I do not know the password of the user, don't want to change it, and really should hardcode it in my script anyways, so regular
sudo isn't really an option. It seems like there has to be some way to work with the command I'm authorized to use?