Language Selection

English French German Italian Portuguese Spanish

Change Prompt Color when logged in as Root

Filed under
HowTos

All security books will recommend you not to allow root SSH logins to your Linux machines. So most of us (administrators) commonly SSH with our regular user credentials and then use "su" to escalate our privileges in order to perform root tasks. If you do this frequently, sometimes it gets a little confusing to make out if you are currently root or regular user. To determine your current status you probably you end up looking at your prompt or type in "whoami".

In this article, I will show you how to change the color of your prompt when you escalate your privileges to a super-user. This technique is a good way to remind yourself that you are holding high privileges (so don’t do anything stupid). This tip is for administrator’s convenience and helps out more if you are managing large number of Linux servers.

Step 1: Login and escalate your privileges to a Super-User

I have a regular user account (username=param) on a Linux server. So in this step, I simply login to the server and then used “su” command to escalate my privileges to a Super-User.

Full Story.

More in Tux Machines

Steven J. Vaughan-Nichols on Red Hat

  • ​Red Hat's JBoss moves to the cloud
    At Red Hat Summit in San Francisco, Red Hat announced the release of Red Hat JBoss Enterprise Application Platform (EAP) 7. The company also introduced the JBoss Core Services Collection to help developers create JBoss enterprise applications.
  • ​Open-source Microsoft protocol aims to be a programming standard
    Microsoft -- yes, Microsoft -- announced at the DevNation conference in San Francisco that it's releasing an open-source language server protocol. More interesting still, this is being done in concert with Codenvy and Red Hat.
  • ​Red Hat makes container development easier
    In San Francisco at Red Hat Summit, Red Hat announced the release of the Red Hat Container Development Kit 2.1 (RHCDK). This new developer kit, one of the many free programming tool kits Red Hat offers its Linux customers, is meant to enable programmers to easily create enterprise-ready containerized applications which target both OpenShift 3 development and Red Hat Enterprise Linux (RHEL) environments.

SFLC represents FOSS developers at the OECD 2016 Ministerial Meeting on the Digital Economy: Innovation, Growth and Social Prosperity

On 21-23 June 2016, Ministers and stakeholders gathered in Cancún, Mexico, for an OECD Ministerial Meeting on the Digital Economy: Innovation, Growth and Social Prosperity, to move the digital agenda forward in four key policy areas foundational to the growth of the digital economy. Our Legal Director, Mishi Choudhary represented the United States civil society at the OECD Ministerial Panel on The Economic and Social Benefits of Internet Openness, chaired by the Canadian Minister of Innovation, Science, and Economic Development Hon’ble Navdeep Singh Bains. Read more

Today in Techrights