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

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Getting "-bash-3.2#" prompt after logging to RHEL client
# 1  
Old 05-25-2017
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


Code:
[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

Moderator's Comments:
Mod Comment Please use CODE tags correctly as required by forum rules!

Last edited by rbatte1; 05-30-2017 at 11:49 AM.. Reason: Changed PHP to CODE tags.
# 2  
Old 05-25-2017
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?
# 3  
Old 05-25-2017
I was able to fix the issue by re-creating /root dir .bashrc & bash_profile file

Code:
[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


Moderator's Comments:
Mod Comment Please use CODE tags correctly as required by forum rules!

Last edited by RudiC; 05-25-2017 at 03:54 AM.. Reason: Changed PHP to CODE tags.
# 4  
Old 05-30-2017
I am using root user and yes /root exists and below is my /etc/passwd output

Code:
[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.


Moderator's Comments:
Mod Comment
Please wrap code, files, input & output/errors in CODE tags, not PHP tags unless it is actually PHP.
It makes it easier to read, uses mono-space characters and preserves multiple spaces for indenting or fixed-width data.

Last edited by rbatte1; 05-30-2017 at 11:52 AM.. Reason: Changing PHP tags to CODE tags
# 5  
Old 05-30-2017
EDIT:

Also, if you had to create the /root user direction then you have some serious issues with your filesystem.
# 6  
Old 06-02-2017
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
# 7  
Old 06-02-2017
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".
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Explaining behaviour of sudo bash "$0" "$@";

I've found this script part on the stackoverflow: if ; then sudo bash "$0" "$@"; exit "$?"; fi I realized that sudo bash "$0" "$@"; is the only needed for me. But the strange thing happens when I move this line outside the IF statement: sudo bash "$0" "$@"; stops the... (9 Replies)
Discussion started by: boqsc
9 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Simplify Bash Script Using "sed" Or "awk"

Input file: 2 aux003.net3.com error12 6 awn0117.net1.com error13 84 aux008 error14 29 aux001.ha.ux.isd.com error12 209 aux002.vm.ux.isd.com error34 21 alx0027.vm.net2.com error12 227 dux001.net5.com error123 22 us008.dot.net2.com error121 13 us009.net2.com error129Expected Output: 2... (4 Replies)
Discussion started by: sQew
4 Replies

7. Shell Programming and Scripting

Logging - "file" and "rm"

Hi, I have a script which deletes various files on the last modified date. command - find /directory/ -mtime +0 -exec rm {} \; How can I "simply" log the filenames of the files which are deleted? I appreciate your help. edits - would this work find /directory/ -mtime +0 -exec rm {}... (2 Replies)
Discussion started by: mcclunyboy
2 Replies

8. UNIX for Dummies Questions & Answers

Reset prompt back to "-bash-3.00$"

Can anyone tell me how to reset the command prompt back to the original 'bas'h prompt as these have all been changed via the /etc/profile to add username and hostname but some are too long. I just want to run it in a local .profile to put it back. Thanks (2 Replies)
Discussion started by: skewbie
2 Replies

9. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies
Login or Register to Ask a Question