Tiny Core Base > TCB Bugs
PS1 prompter colour, from /etc/.profile is not used properly.
nick65go:
this piece of code, from /etc/.profile is not used properly.
--- Code: ---# Prompt format for Ash (Bash use /etc/bashrc).
#
if [ "`id -u`" -eq 0 ]; then
# Light red and blue colored prompt.
#PS1='\e[1;31m\u@\h\e[0m:\e[1;34m\w\e[0m\# '
PS1='\u@\h:\w\# '
else
# Light green and blue colored prompt.
PS1='\e[1;32m\u@\h\e[0m:\e[1;34m\w\e[0m\$ '
#PS1='\u@\h:\w\$ '
fi
--- End code ---
the colors (red for root, green for tc user) are not shown in aterm, neither in real terminal/console (Alt+F1). because the /etc/skel/.profile will overwrite them with simple code
--- Code: ---# Environment variables and prompt for Ash SHell
# or Bash. Default is a classic prompt.
#
PS1='\u@\h:\w\$ '
export PS1
--- End code ---
Maybe for tc user is better to have directly in /etc/skel/.profile
--- Code: ---# Light green and blue colored prompt.
PS1='\e[1;32m\u@\h\e[0m:\e[1;34m\w\e[0m\$ '
--- End code ---
Also, I can not activate the red color root-user. Using "sudo su" will not help. I can not login as root (by default), because /etc/passwrd
I can leave without these nice colors. But the idea is about the audit of TC script code.
curaga:
I think we can leave those in, they can be examples.
Thanks for looking over the scripts.
Rich:
Hi nick65go
--- Quote from: nick65go on August 11, 2020, 07:38:05 PM --- ... because the /etc/skel/.profile will overwrite them with simple code ...
--- End quote ---
User configuration settings are supposed to override system wide settings. That allows users to configure their preferences.
--- Quote --- ... Also, I can not activate the red color root-user. Using "sudo su" will not help. I can not login as root (by default), because /etc/passwrd ...
--- End quote ---
Did you try modifying the /root/.profile file? You will also need to backup /root if you make changes to it.
nick65go:
Hi Rich,I know that /home/.profile will take precedence over /etc/profile; and if I change something in /home/tc then I would need to backup it etc. I just highlighted that the code in /etc/.profile is NEVER used for prompter color. That code section can be deleted (curaga advised me that it can stay, as demo).
Also, I manually add a line in /root/.profile as
--- Code: ---tc@box:~$ cat /root/.profile
#!/bin/sh
PS1='\e[1;31m\u@\h\e[0m:\e[1;34m\w\e[0m\# '
--- End code ---
but the problem is (as I said it previously) that I can not login as root user. I tried to add a password to user root. It complaint that I need a strong one, so I chose one as "ABC123456789!" (with out " ")
--- Code: ---tc@box:~$ sudo su
root@box:/home/tc# passwd
Changing password for root
New password:
Retype password:
passwd: password for root changed by root
root@box:/home/tc# exit
tc@box:~$ login
box login: root
Login incorrect
box login: ^C
tc@box:~$
--- End code ---
I think it is because something/somewhere not allow me as user root, just sudo su:
--- Code: ---tc@box:~$ sudo su
root@box:/home/tc# cat /etc/passwd
root:x:0:0:root:/root:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/false
tc:x:1001:50:Linux User,,,:/home/tc:/bin/sh
root@box:/home/tc#
root@box:/home/tc# cat /etc/shadow
root:$1$fXlnzkxU$li.1CDsMnFto.iMldZZNy1:18486:0:99999:7:::
lp:*:13510:0:99999:7:::
nobody:*:13509:0:99999:7:::
tc::13646:0:99999:7:::
root@box:/home/tc#
--- End code ---
PS: in aterm says "login incorrect"; but in real console (crt+alt+f1) it accepts the password but instantly switch back to tc user.All was done live, no backup for /root, I just test from Xorg+flwm+aterm.
UPDATES: deleted everything from /root/.profile (keep just row with PS1); and now I can login from console (ctlr+alt+f1) with red color.But from Xorg (back with ctrl+alt+f2) still login error. I will exit from Xorg (crtl+alt+backspace) and come back here to report again.
curaga:
Check root's files in /root. It redirects to user tc on purpose, for the boot autologin.
Navigation
[0] Message Index
[#] Next page
Go to full version