The following are the steps I performed:
- SSH to a CentOS 6.x machine that is in the local network with command
- Enter the root user password
- I was able to successfully login to the machine, but I only get the bash terminal instead of the root user terminal.
Last login: Wed Apr 25 18:04:32 2018 from 192.168.0.27
-bash: /root/.bashrc: Permission denied
I am trying to understand what is the problem here.
- I am able to login to any other machine in the local network without having this issue.
- Also, from the bash terminal, I am able to switch to the super user account with "su" command.
Few command executed on the remote machine which I'm trying to login and its output.
-bash-4.1# whoami root -bash-4.1# stat /root/.bashrc File: `/root/.bashrc' Size: 221 Blocks: 8 IO Block: 4096 regular file Device: 802h/2050d Inode: 32510289 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2018-04-26 10:09:04.206129757 +0530 Modify: 2018-04-25 18:04:59.354903860 +0530 Change: 2018-04-25 18:04:59.389903855 +0530 -bash-4.1# file /root/.bashrc /root/.bashrc: ASCII text -bash-4.1# lsattr /root/.bashrc -------------e- /root/.bashrc
#/bin/bash -x # 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 export PATH="/opt/postgres/postgresql:$PATH"
Can anyone please help me understand this?