Hi all,
Recently I created a new user on my CentOS cPanel host that could log into the system via ssh and removed the ability for root to ssh in.
Now I ssh in as the user account and then su to gain root when necessary...
Now I find that I am getting a different bash profile or environment when I su to root than when I was ssh'ing in directly...
Does that sound right?
I basically think that there must be a different bash_profile or some other relationship that is dictating a different environment when it do it each way.
Can I get some assistance on this please?
I noticed it because when I used to ssh in to the host as root I would be able to do an ifconfig for example straight from the prompt - ie the /sbin path was in the $PATH
Now I have to call the command by /sbin/ifconfig
etc.
I thought I might be getting the PATH from the original user:
Code:
root@jupiter [/home/stardotstar]# echo $PATH
/usr/local/jdk/bin:/usr/local/jdk/bin:/usr/kerberos/bin:/usr/lib/courier-imap/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/stardotstar/bin:/usr/local/bin:/usr/X11R6/bin
root@jupiter [/home/stardotstar]#
and I know this will look stupid to someone who knows how futile what I am trying to do this way is but I have tried things like:
Code:
root@jupiter [/home/stardotstar]# . /root/.bash_profile
root@jupiter [/home/stardotstar]# ifconfig
bash: ifconfig: command not found
root@jupiter [/home/stardotstar]# . /root/.bashrc
root@jupiter [/home/stardotstar]# ifconfig
bash: ifconfig: command not found
Can someone set me straight on this please?
TIA
\\'