How to switch the #(fence) symbol by the $(dollar sign) in the terminal after switching user

Asked

Viewed 241 times

0

I’ll be direct, because the title denotes part of my curiosity about the linux console.

Explain

In some distros like - xPud and Basiclinux3 no "HOME" support is only "ROOT" and ready!

In the distro I’m using, the header "#" in console does not change to "$" after logging in.

Doubt

I don’t know how this works and/or simply how it should be done. Does anyone know!?

2 answers

1

The archive /etc/profile usually has a variable called PS1 (you can find it by typing echo $PS1), it has the function of creating a mask for the input of the Bash, changing its value, changes the writing on your terminal.

export PS1='\u@\h \w $ '
# \u mostra o nome do usuário
# \h mostra o host do usuário (nome da maquina)
# \w ou \W mostra o path, para W pasta atual e w caminho absoluto
# para colorir a saída, basta usar '\[\033[01;34m\]' para colorir com verde e negrito.

To apply to all users, just reset the variable in /etc/profile

export PS1='\[\033]0;\u@\h:\w\007\]'

0


[...] how does it work [...] how this should be done [...]



I solved it this way:

I downloaded the package passwd.tgz of Slackware-0.4

This contains the "Getty" which is the second of the three programs (init, Getty and login) used by the system to allow users access.

Until then, the distro in use had been built minimalist based on this package only init

Having done that, I had to create two new files in the directory /etc, are they:

group
passwd


To the archive "group" wrote like this:

root::0:root,lx


Already in the "passwd", done:

root::0:0::/root:/bin/sh
lx::1001:1001::/home/lx:/bin/sh


This profitable work, it was necessary because not all distros available on the web, comes complete, present themselves in a way about a single user the "root".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.