LinuxQuestions.org
Help answer threads with 0 replies.
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 12-30-2018, 02:47 PM   #16
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11

I just wanted to know is it possible or not. I understand that it is possible but a bad idea.
 
Old 12-31-2018, 09:57 AM   #17
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by hrsetrdr View Post
Code:
sudo su
Boom, now as long as you keep the terminal open you are root....Install, delete, modify the system as you wish.
That's sort of a, um, weird/interesting way to do it (IMHO). I usually just issue either "su - root" + password or "sudo /bin/bash" and work as root until I issue exit/^D. I always make sure that root's prompt (PS1) red as a visual reminder that a slip of the keyboard could be disastrous.
 
Old 12-31-2018, 11:59 AM   #18
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,726

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by rnturn View Post
[snip] I always make sure that root's prompt (PS1) red as a visual reminder that a slip of the keyboard could be disastrous.
I used to do that, too, until a tech at the data center freaked out when I logged in at the console while he was watching I now set PS1 to blue, and have the background on my remote terminals set to a red-ish (kinda pink) color (just red was pretty rough on the eyes)

Point being: Some additional reminder that one is logged in as root is an excellent idea.
 
Old 12-31-2018, 01:34 PM   #19
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by scasey View Post
I now set PS1 to blue, and have the background on my remote terminals set to a red-ish (kinda pink) color (just red was pretty rough on the eyes)
Agreed. A red background would be tough to read for very long. I just set the prompt string itself to red and return to 'normal' once the prompt has been displayed. If you want to limit your time on the system as root, make the prompt blink. :^D
 
Old 12-31-2018, 01:39 PM   #20
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by rnturn View Post
I always make sure that root's prompt (PS1) red as a visual reminder that a slip of the keyboard could be disastrous.
I use a reverse video prompt that ends with a # char (and a space).
Makes the prompt stand out and warns me twice that I'm root now.
 
Old 12-31-2018, 02:45 PM   #21
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member Response

Hi,

I just set my prompt to 'red' for root and 'green' for user. One way is through '~/.bashrc' ;
Code:
#.bashrc
#08-30-06 12:20 gws copied loki:/root

# Add bin to path
export PATH="$PATH:$HOME/bin"
#export PATH="$PATH:$HOME:/bin"
# Dynamic resizing
shopt -s checkwinsize
#
#save bash history so as to share

shopt -s histappend
PROMPT_COMMAND='history -a'

# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

#08-29-06 11:40 gws

if [ `id -un` = root ]; then
   PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
 else
   PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi
#
# Add color
eval `dircolors -b`

#Terminus is a very nice Unicode font for the Linux console
#02-02-12 gws
#from dugan's site http://duganchen.ca/writings/slackware/fonts/

#04-30-12 11:41 removed
#
#if [ $TERM = "linux" ]; then
#    setfont ter-v16n
#fi

# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias listlong='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'

#08-29-06 11:50 gws

#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
   trap "rm -f ~$LOGNAME/.bash_history" 0

#The older KSH-style form
#   trap 0 rm -f ~$LOGNAME/.bash_history
Very useful!
Hope this helps.
Have fun & enjoy!
 
2 members found this post helpful.
Old 12-31-2018, 03:25 PM   #22
ChuangTzu
Senior Member
 
Registered: May 2015
Location: Where ever needed
Distribution: Slackware/Salix while testing others
Posts: 1,718

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
Quote:
Originally Posted by hack3rcon View Post
Hello.
Is it possible to make a user like root? I mean is that when a user exist in "sudoers" file then for management task "sudo" must used but is it possible without sudo?

Thank you.
Possible yes, but why? It would be similar to having two Presidents, two Pope's, two God's, or the all to often used too many Chiefs and not enough Indians, etc... Better to create proper sudo accounts with strong but restricted abilities.
 
Old 12-31-2018, 03:32 PM   #23
ChuangTzu
Senior Member
 
Registered: May 2015
Location: Where ever needed
Distribution: Slackware/Salix while testing others
Posts: 1,718

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
Quote:
Originally Posted by onebuck View Post
Hi,

I just set my prompt to 'red' for root and 'green' for user. One way is through '~/.bashrc' ;Very useful!
Hope this helps.
Have fun & enjoy!
Thank you for that!
 
Old 01-01-2019, 01:01 AM   #24
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by ehartman View Post
... that ends with a # char (and a space).
The "# -> root" and "$ -> normal user" prompt convention has been around for, well, ever. Not everything that's been around for a long time is necessarily bad. :^)
 
  


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
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
sys admin vs network admin sulekha Linux - General 5 01-11-2009 05:03 AM
Sudo without having to type "sudo?" Mitch G Linux - Security 3 09-28-2006 02:16 PM
2K admin now RHEL4 admin (I have some questions) wilsryan Red Hat 5 01-30-2006 12:18 PM
User admin and N/w admin on Gnome hangs ssrini *BSD 2 07-28-2005 07:55 AM

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

All times are GMT -5. The time now is 09:40 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
Open Source Consulting | Domain Registration