LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 01:30 AM   #1
mhsahkir
LQ Newbie
 
Registered: Dec 2014
Location: U.S.A ,NEWYORK
Posts: 26

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 01:31 AM.
 
Old 03-29-2015, 02: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, 06:53 PM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

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

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:	635
Size:	37.4 KB
ID:	17948  
 
Old 03-31-2015, 07:38 AM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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, 08: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, 12:39 PM   #7
mhsahkir
LQ Newbie
 
Registered: Dec 2014
Location: U.S.A ,NEWYORK
Posts: 26

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


Reply



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 01:56 PM
[SOLVED] how do i change "bash-4.1#" to "user@hostname try-alls Slackware 18 08-22-2010 03:33 AM
PostFix + ISPConfig mail return "unknown user" or "no such user here" Jacky444 Linux - Server 1 02-10-2010 04:21 PM
Cant do "mount/umount" on USB flash drive as regular user Salgeras Slackware 5 11-01-2007 08:09 PM
Shorten a Qmail user name to "user" instead of "user@domain.com" anorman Linux - Software 0 12-12-2003 08:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:43 AM.

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
Open Source Consulting | Domain Registration