Active Topics

 


Reply
Thread Tools
Posts: 175 | Thanked: 210 times | Joined on Mar 2013
#1
Hello everybody,

I seem to have an issue with maemo and root's .profile file.

First I've added an alias in the user's .profile :
alias ll='ls -la'

Saved the file and closed the ssh connection. Upon the next ssh connection (or after opening a new terminal window) the ll command outputted what ls -la would have, so it's working.

Doing the same thing with /root/.profile doesn't work (it displays : /bin/sh: ll: not found).
I have to mention that I don't use ssh for root, I rather ssh with user and use the sudo gainroot command. Is it why it doesn't work?

I also noticed "mesg n" in /root/.profile : what is it for?

Also when being root and doing a simple cd command without any argument, it sends me to /home/user. Shouldn't it send me to /root, as that should be root's home directory. Could this be the issue (/root/.profile isn't sourced because /root is not root's home)?

How to fix it (source /root/.profile when connected as root, to have aliases available)?

Last edited by Malakai; 2016-08-10 at 10:17. Reason: Solved
 
Posts: 175 | Thanked: 210 times | Joined on Mar 2013
#2
Just a bump up
 
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:
Reply


 
Forum Jump


All times are GMT. The time now is 20:33.