View Single Post
Posts: 175 | Thanked: 210 times | Joined on Mar 2013
#3
I think I found a solution
For becoming root and having the .profile sourced it is better to use the command "root" rather than "sudo gainroot".
I don't know exactly what each of these 2 commands involve in the background, but from what I've understand, by using the command "root", you really become root (when doing pwd after becoming root with the "root" command, you get to /root folder), but when using "sudo gainroot" you have temporary root privileges (so when doing pwd after becoming root with the "sudo gainroot" command, you get to /home/user folder).
Please correct me if I'm saying non sense, and give some more infos if you know more.

So in conclusion if you want the .profile file to be sourced for root, become root by using the command "root", and not "sudo gainroot".

My other question remains as I've not found any infos about it : what is "mesg n" for in /root/.profile ?
 

The Following User Says Thank You to Malakai For This Useful Post: