root@localhost not root@xx.xxx.xx

Hi there,
I am using Putty to access my server. This is my first time using Linode.
Steps that I used

  1. Access putty
  2. login : root
  3. Enter password

but the login become root@localhost. Usually root@xx.xxx.xx (IP address).
What is missing ?

4 Replies

This is the default shell prompt for whatever shell you're using. You can change it by setting it up in /etc/profile.

See:

https://en.wikibooks.org/wiki/Guide_to_Unix/Explanations/Shell_Prompt

-- sw

Hi Stevewi,

Can you give me the exact command ? This is my first time using Linode. I have experienced deploy server by Vultr or OVH and never got this problem.

Hey @dekpendi, you might find it helpful to follow the instructions we have for using PuTTY in our guide on Using SSH on Windows.

You write:

Can you give me the exact command ? This is my first time using Linode. I have experienced deploy server by Vultr or OVH and never got this problem.

PS1 is the environment variable that controls the shell prompt. You can set it anywhere you want in any file your shell runs when you log in.

Where you change it depends on how much you want to enforce it. If you set it in /etc/profile and don't change it anywhere else, all shells will have the same prompt. If you override the default setting for PS1 in ~/.profile or ~/.bashrc, then only shells for the login user will have that prompt.

The (string) contents of $PS1 determines the appearance of your prompt. Here's a link that explains what all the cryptic characters mean:

https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

The use of putty is not relevant to any of this…as is your experience with OVH and Vultr. The OVH/Vultur systems had different default content in /etc/profile and/or root's .profile or .bashrc out of the box…that's all. There's nothing magic about the content of any of these, they're just a shell scripts. It's what's in $PS1 when your shell of choice shows you the prompt that matters.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct