Support Support Downloads Knowledge Base Apex Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[QFx] DG prompt shows 'dg1 03:56:01~$' instead of the default prompt '[root@dg1 ~]#'

0

0

Article ID: KB37117 KB Last Updated: 18 Jun 2021Version: 1.0
Summary:

The QFabric DG shows a different prompt 'dg1 03:56:01~$' from the usual default prompt, which is '[root@dg1 ~]#' in QFX3100 devices.

This article explains the different prompts and how to change it back to the default prompt.

Symptoms:

When Logging in to the DG via console or management interface, you should get the following prompt:

dg1 login: root
Password: 
Last login: Wed Jun  2 03:57:35 from 10.107.105.227
Juniper QFabric Director 13.1.9350 2020-08-28 18:31:41 UTC

[root@dg1 ~]# 

However, in some cases, the following prompt is displayed, which may lead to misinterpretation or confusion:

dg1 login: root
Password: 
Last login: Tue Jun  1 09:09:48 from 10.107.213.1
Juniper QFabric Director 13.1.9350 2020-08-28 18:31:41 UTC

dg1 09:52:24~$ 
Cause:

The following lines in /root/.bash_profile is the cause for this behavior.

PS1='\e[1;36m\h \t\e[1;33m\w$ \e[m' 
alias dir="ls -last --color | more" 

Note: PS stands for prompt statement which changes the default prompt. alias is to assign an alias for a Linux command

Solution:

The different prompt in the display does not cause any impact, but it may lead to confusion for the user. To move to the usual default prompt, remove the last two lines in "/root/.bash_profile" file from the location as shown below:

  1. Check the contents of "/root/.bash_profile" file:

    dg1 09:52:24~$ cat /root/.bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin

    export PATH
    unset USERNAME

    PS1='\e[1;36m\h \t\e[1;33m\w$ \e[m'
    alias dir="ls -last --color | more"
  2. Remove the last two lines highlighted above from the file "/root/.bash_profile" by following the below steps.

    i. open the file using vi editor [vi /root/.bash_profile]
    ii. move the cursor to the line to be deleted and type dd in the keyboard
    iii. to save the changes use esc : wq keys in keyboard 
  3. Check the lines are deleted from file "/root/.bash_profile"

    dg1 10:02:10~$ cat /root/.bash_profile 
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin

    export PATH
    unset USERNAME
  4. Exit and login back to the DG, the usual prompt appears

    dg1 10:02:10~$exit

    Juniper QFabric Director 13.1.9350 2020-08-28 18:31:41 UTC
    dg1 login: root
    Password: 
    Last login: Wed Jun  2 09:52:23 on ttyS0
    Juniper QFabric Director 13.1.9350 2020-08-28 18:31:41 UTC
    [root@dg1 ~]#
     
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search