SOLVED root login bash alias notifications

marjwyatt

Well-Known Member
Jun 23, 2014
51
6
58
cPanel Access Level
Reseller Owner
A few weeks ago, I began seeing these messages when logging into root using SSH.

-bash: alias: source: not found
-bash: alias: /root/.bashrc: not found
-bash: alias: source: not found
-bash: alias: /root/.bashrc: not found
-bash: alias: source: not found
-bash: alias: /root/.bashrc: not found

The login used to be clean and I have done nothing intentional to set up bash aliases. So far, it hasn't inhibited anything I want to do while logged in but I'd like to fix the problem and I honestly don't know where to begin. None of my internet searches have produced useful solutions.

This is my server version information:
Server version: Apache/2.4.41 (cPanel)
Server built: Sep 16 2019 17:10:52

Any advice leading to a solution would be greatly appreciated.
 

marjwyatt

Well-Known Member
Jun 23, 2014
51
6
58
cPanel Access Level
Reseller Owner
No. I've not added anything to those files. Up until a few weeks ago, these notifications weren't happening when I used SSH to login to root.

Here are the results of the commend you told me to run:

Code:
root@server [~]# stat /root/.bashrc
  File: '/root/.bashrc'
  Size: 455             Blocks: 8          IO Block: 4096   regular file
Device: 16h/22d Inode: 37753620    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-11-18 12:24:03.812056593 -0800
Modify: 2019-09-22 09:25:35.560599410 -0700
Change: 2019-09-22 09:25:35.560599410 -0700
 Birth: -
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
Whether or not you've added anything to the files, I'd like to know if anything is present within them. The size indicates that there is data within, the permissions are correct.
 

marjwyatt

Well-Known Member
Jun 23, 2014
51
6
58
cPanel Access Level
Reseller Owner
Here is the output from /root/.bashrc_profile
Code:
root@server [~]# cat /root/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
Here is the output from /root/.bashrc
Code:
root@server [~]# cat /root/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
alias composer="php -d allow_url_fopen=On /home/virtuall/composer.phar" source /root/.bashrc
alias composer="php -d allow_url_fopen=On /home/virtuall/composer.phar" source /root/.bashrc
alias composer="php -d allow_url_fopen=On /home/virtuall/composer.phar" source /root/.bashrc
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
By default the following is present:

Code:
[root@server ~]# cat /root/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
If you remove those lines at the bottom does the issue persist?
 

marjwyatt

Well-Known Member
Jun 23, 2014
51
6
58
cPanel Access Level
Reseller Owner
That did it. Maybe those were added by me when I was trying to implement some software that was supposed to help with updating php code. My bad!

Thanks for your help.
 
  • Like
Reactions: cPanelLauren