Getting "-bash-3.2#" prompt after logging to RHEL client

Hi,

I am getting the -bash-3.2# prompt whenever I am trying to logging in the RHEL machine

[root@mindnic-01 ~]# ssh mindnic-02
root@mindnic-02's password:
Last login: Thu May 25 14:06:31 2017 from 10.250.107.81
Could not chdir to home directory /root: No such file or directory
-bash-3.2# 

Please help me resolve this issue.

Regards,
Muzaffar

Methinks the real problem is revealed in the error message one line above. No access to the user's home dir implies no ~/.profile nor ~/.bashrc being executed that normally set the command prompt.
What user do you login to? Does /root exist? What's in /etc/passwd ?

I was able to fix the issue by re-creating /root dir .bashrc & bash_profile file

[root@mindnic-01 ~]# ssh mindnic-02
root@mindnic-02's password:
Last login: Thu May 25 14:44:28 2017 from mindnic-01.lab.mindteck.com
[root@mindnic-02 ~]#

I will update if I am facing the same issue again.

Regards,
Muzaffar

I am using root user and yes /root exists and below is my /etc/passwd output

[root@mindnic-02 ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:4294967294:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
avahi-autoipd:x:100:101:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
distcache:x:94:94:Distcache:/:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
squid:x:23:23::/var/spool/squid:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
exim:x:93:93::/var/spool/exim:/sbin/nologin
natedev:x:500:500::/home/natedev:/bin/bash
raj:x:501:501::/home/raj:/bin/bash
muza:x:502:502::/home/muza:/bin/bash
ss:x:503:503::/home/ss:/bin/bash
mysql:x:504:504::/home/mysql:/bin/bash
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
tt:x:505:505::/home/tt:/bin/bash
me:x:517:517::/home/me:/bin/bash
[root@mindnic-02 ~]#

What could be the real reason to occur such issues.

EDIT:

Also, if you had to create the /root user direction then you have some serious issues with your filesystem.

Oh my god, I cannot afford to crash this system as it has been configured with test environment.

How do I resolve this issue please let me know.

Regards,
Muzaffar

People in here might be in a position to help you with your real issue IF you precisely and verbosely describe the real issue you are facing.
If you repeat the title of the thread, my answer will be: "Modify the PS1 parameter".

Another equally helpful suggestion might be to tell you to stop removing your home directory (i.e., /root ) while you are running whatever tests you're running in your test environment.