Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800
Rep:
Quote:
Originally Posted by hrsetrdr
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.
[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.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800
Rep:
Quote:
Originally Posted by scasey
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
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
Distribution: Slackware/Salix while testing others
Posts: 1,718
Rep:
Quote:
Originally Posted by hack3rcon
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.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800
Rep:
Quote:
Originally Posted by ehartman
... 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. :^)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.