Securing the dietpi login with new user sets a green PS1?

I prefer sshd, so I disabled both dietpi and root logins:

passwd --delete dietpi
usermod -s /usr/sbin/nologin dietpi
useradd -c 'Daisuke' -ms /bin/bash daisuke
passwd daisuke
echo 'daisuke ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/daisuke
chmod 0440 /etc/sudoers.d/daisuke
sed -i 's|^PermitRootLogin.*|PermitRootLogin no|' /etc/ssh/sshd_config
systemctl restart sshd

PS1 prompt is:

root@chaos:~# echo $PS1
${debian_chroot:+($debian_chroot)}\u@\h:\w\$
root@chaos:~#
logout
daisuke@chaos:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

I see the /home/dietpi/.bashrc is totally different from a regular user .bashrc, is this generated by the installer? Can you let me know what is the related code or commands? From what I see, is identical to a no-login root .bashrc.

Why not simply using the nologin method to disable user accounts. That’s how it is ususally done for all other users. Not even the one created by DietPi

cat /etc/passwd

https://linuxconfig.org/disabling-user-logins-to-linux-system

I login into each Pi through ssh on a regular basis. Is fine, I was simple trying to determine how the dietpi users gets a special .bashrc.

For me the output of echo $PS1 looks identical to yours, even that my user are not disabled.

dietpi@DietPiProd:~$ echo $PS1
${debian_chroot:+($debian_chroot)}\u@\h:\w\$
dietpi@DietPiProd:~$
dietpi@DietPiProd:~$ exit
logout
root@DietPiProd:~#
root@DietPiProd:~# echo $PS1
${debian_chroot:+($debian_chroot)}\u@\h:\w\$
root@DietPiProd:~#

Compare the dietpi user’s .bashrc with /etc/skel/.bashrc, which is the one used for new users. AFAIK on older Armbian-based images these were different compared to plain Debian base-files indeed. Our new images however should ship with Debian defaults.