Try   HackMD

How to Create Users in Linux with useradd (Step-by-Step)

# On ubuntu Ubuntu 24.04.2 LTS, user created with 
# this command its login shell is /bin/sh
sudo useradd -m username

sudo useradd -m -s /bin/bash username
sudo passwd username

useradd 指令的預設登入 Shell 取決於系統的設定,通常是 /bin/sh 或 /bin/bash,這可以從 /etc/default/useradd 檔案查看:

grep SHELL /etc/default/useradd

使用者預設登入 shell

echo $SHELL

針對特定使用者

getent passwd username

cat /etc/passwd | grep username
cat /etc/passwd | awk -F: '{print $1, $7}'

注意: useradd 與 adduser 為兩個不同的指令!其行為不完全相同

# On ubuntu Ubuntu 24.04.2 LTS, user created with 
# this command its login shell is /bin/bash
sudo adduser username 


sudo adduser --shell /bin/bash username

How do I check which shell I am using?
How to Create Users in Linux with useradd (Step-by-Step)