LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2015, 02:30 AM   #1
mhsahkir
LQ Newbie
 
Registered: Dec 2014
Location: U.S.A ,NEWYORK
Posts: 24

Rep: Reputation: Disabled
how to change "-bash-4.1$ "to regular user mood user user@


I am new with linux system somehow my regular user mode changed and its became "-bash-4.1$ " also "how to switch root to regular user"? Thanks advance.

Last edited by mhsahkir; 03-29-2015 at 02:31 AM.
 
Old 03-29-2015, 03:48 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read man page of bash. It has a section on PS1 environment variable. By setting this variable appropriately we can alter the command line prompt.

Code:
man bash
 
Old 03-30-2015, 07:53 PM   #3
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 939

Rep: Reputation: 174Reputation: 174
Quote:
"how to switch root to regular user"?
Could you expand on that problem?
 
Old 03-30-2015, 10:35 PM   #4
mhsahkir
LQ Newbie
 
Registered: Dec 2014
Location: U.S.A ,NEWYORK
Posts: 24

Original Poster
Rep: Reputation: Disabled
how to change "-bash-4.1$ "to regular user mode

@JeremyBoden could you plz check my attached screenshot.
Attached Thumbnails
Click image for larger version

Name:	business-card-in-modern-style_23-2147506540.jpg
Views:	17
Size:	37.4 KB
ID:	17948  
 
Old 03-31-2015, 08:38 AM   #5
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 939

Rep: Reputation: 174Reputation: 174
According to your terminal display:-

1. You login as user IT (needs two tries at password)

2. You then su - and enter the password for root.

3. You then su - student

You don't need to login as users who you don't use...
For example, if I was already logged in, I could do the following:-
Code:
jeremy@hector:~$ 
jeremy@hector:~$ su -
Password: (my root password was entered)
root@hector:~# whoami
root
root@hector:~# logout
jeremy@hector:~$ whoami
jeremy
jeremy@hector:~$
Basically, why not just login as student?
 
Old 03-31-2015, 09:01 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
When login as IT run following in the terminal:

Code:
export PS1='\u@\H ~]$'
You would have to run this each time.

Put this in .bash_profile of your home directory and it would run automatically.

This prompt is set by bash by reading the PS1 environment variable. And usually set in one of /etc/profile or ~/.bash_profile.
So somehow it got changed for IT.

Again read man page of bash.
 
1 members found this post helpful.
Old 03-31-2015, 01:39 PM   #7
mhsahkir
LQ Newbie
 
Registered: Dec 2014
Location: U.S.A ,NEWYORK
Posts: 24

Original Poster
Rep: Reputation: Disabled
ok thanks guys i got back my regular user mode. I appreciated your kind reply @Veera.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] multiple user accounts with uid 0 . I want to delete all user names except "root" m00seman645 Linux - Newbie 2 10-21-2011 02:56 PM
[SOLVED] how do i change "bash-4.1#" to "user@hostname try-alls Slackware 18 08-22-2010 04:33 AM
PostFix + ISPConfig mail return "unknown user" or "no such user here" Jacky444 Linux - Server 1 02-10-2010 05:21 PM
Cant do "mount/umount" on USB flash drive as regular user Salgeras Slackware 5 11-01-2007 09:09 PM
Shorten a Qmail user name to "user" instead of "user@domain.com" anorman Linux - Software 0 12-12-2003 09:29 AM


All times are GMT -5. The time now is 02:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration