I have an alias I use to run sudo -s
called ssu
. I want it to also source my root session from the .profile
in my home directory.
Other answers seem to say that this is the solution:
alias ssu='sudo -s && sudo -Hu root source /my_home/.profile'
But executing source
as root user doesn't make it the profile for my shell. It runs the command after I log out of my root session.
Is there a way to seamlessly execute sudo -s
and source
(as root) in a row without having to run two commands?
source
as root using a function or a script – Sam Bishop Aug 05 '20 at 16:40