Everything was working just fine before but we have put in new restrictions on the users where we no longer have sudo ability.
To sum it up, I have custom functions which saved me 5+ minutes of running various commands, changing ownership of files/folders moving things around and cleanup.
With the removal of sudo from my profile I can only be me, or switch to the group user.
How can I have my script do things such as remove files owned by the group user or other things if I cannot make use of sudo?
I have tried switching to the group user in my .bashrc file then follow that with the commands and then exit out but that DOES NOT work. It only puts me into the shell as the group user and none of the variables defined in the .bashrc file are viewable. This goes for he export variables too.
My bashrc file is approximately 722 lines and slowly grows. I started this 4 years ago and have kept it as I transition to various projects.
The SA is saying to break up the .bashrc file and move things to the group user .bashrc file but my God that would be a nightmare as it would null and void basically everything that I and the other developers have been using.
My .bashrc file has literally been adopted by all the other developers as it requires minimal modifications per user (literally 1 thing needs to be changed in the file for each developer) in order for it to work.
Is there a solution or am I just HOSED on trying to keep using it?
Not sure what the correct terms are for this whole thing I'm doing but I hope someone understands what I am doing.
# switch to user
groupUser;
# test call out. This does not run
echo "Show me the var val ${testxyz};
exit;
echo "Back to me user ${USER}";
when .bashrc loads it is just showing me as the groupUser, none of the other stuff executes.
*
By groupUser, it is just an alias that allows me to switch to that user which is in the same group as my user but is the owner of select folders/files etc.
e.g. myUser:groupUser and groupUser:groupUser *
groupUser
command is it a script or alias that runs "sudo" or "su" in some way? – Jeff Schaller Nov 29 '21 at 19:41groupUser
? And that opens a shell for the group user? Can you doecho id | groupUser
? – Hauke Laging Nov 29 '21 at 19:50groupUser
in.bashrc
? Is theecho
executed if you press