Ubuntu & Debian: Use variable for username
Signed-off-by: Scott G. Ainsworth <scott@ainsworth.us> Signed-off-by: Richard Laager <rlaager@wiktel.com> [Applied to Ubuntu 20.04 Raspberry Pi & Debian Buster.]
This commit is contained in:
committed by
Richard Laager
parent
4c3ec4c594
commit
3c04e929a1
@@ -881,14 +881,16 @@ Step 6: First Boot
|
|||||||
|
|
||||||
#. Create a user account:
|
#. Create a user account:
|
||||||
|
|
||||||
Replace ``username`` with your desired username::
|
Replace ``YOUR_USERNAME`` with your desired username::
|
||||||
|
|
||||||
zfs create rpool/home/username
|
username=YOUR_USERNAME
|
||||||
adduser username
|
|
||||||
|
|
||||||
cp -a /etc/skel/. /home/username
|
zfs create rpool/home/$username
|
||||||
chown -R username:username /home/username
|
adduser $username
|
||||||
usermod -a -G audio,cdrom,dip,floppy,netdev,plugdev,sudo,video username
|
|
||||||
|
cp -a /etc/skel/. /home/$username
|
||||||
|
chown -R $username:$username /home/$username
|
||||||
|
usermod -a -G audio,cdrom,dip,floppy,netdev,plugdev,sudo,video $username
|
||||||
|
|
||||||
#. Mirror GRUB
|
#. Mirror GRUB
|
||||||
|
|
||||||
|
|||||||
@@ -595,19 +595,21 @@ Step 5: First Boot
|
|||||||
|
|
||||||
#. Create a user account:
|
#. Create a user account:
|
||||||
|
|
||||||
Replace ``username`` with your desired username::
|
Replace ``YOUR_USERNAME`` with your desired username::
|
||||||
|
|
||||||
|
username=YOUR_USERNAME
|
||||||
|
|
||||||
UUID=$(dd if=/dev/urandom bs=1 count=100 2>/dev/null |
|
UUID=$(dd if=/dev/urandom bs=1 count=100 2>/dev/null |
|
||||||
tr -dc 'a-z0-9' | cut -c-6)
|
tr -dc 'a-z0-9' | cut -c-6)
|
||||||
ROOT_DS=$(zfs list -o name | awk '/ROOT\/ubuntu_/{print $1;exit}')
|
ROOT_DS=$(zfs list -o name | awk '/ROOT\/ubuntu_/{print $1;exit}')
|
||||||
zfs create -o com.ubuntu.zsys:bootfs-datasets=$ROOT_DS \
|
zfs create -o com.ubuntu.zsys:bootfs-datasets=$ROOT_DS \
|
||||||
-o canmount=on -o mountpoint=/home/username \
|
-o canmount=on -o mountpoint=/home/$username \
|
||||||
rpool/USERDATA/username_$UUID
|
rpool/USERDATA/${username}_$UUID
|
||||||
adduser username
|
adduser $username
|
||||||
|
|
||||||
cp -a /etc/skel/. /home/username
|
cp -a /etc/skel/. /home/$username
|
||||||
chown -R username:username /home/username
|
chown -R $username:$username /home/$username
|
||||||
usermod -a -G adm,cdrom,dip,lxd,plugdev,sudo username
|
usermod -a -G adm,cdrom,dip,lpadmin,lxd,plugdev,sambashare,sudo $username
|
||||||
|
|
||||||
#. Reboot::
|
#. Reboot::
|
||||||
|
|
||||||
|
|||||||
@@ -1069,19 +1069,21 @@ Step 6: First Boot
|
|||||||
|
|
||||||
#. Create a user account:
|
#. Create a user account:
|
||||||
|
|
||||||
Replace ``username`` with your desired username::
|
Replace ``YOUR_USERNAME`` with your desired username::
|
||||||
|
|
||||||
|
username=YOUR_USERNAME
|
||||||
|
|
||||||
UUID=$(dd if=/dev/urandom bs=1 count=100 2>/dev/null |
|
UUID=$(dd if=/dev/urandom bs=1 count=100 2>/dev/null |
|
||||||
tr -dc 'a-z0-9' | cut -c-6)
|
tr -dc 'a-z0-9' | cut -c-6)
|
||||||
ROOT_DS=$(zfs list -o name | awk '/ROOT\/ubuntu_/{print $1;exit}')
|
ROOT_DS=$(zfs list -o name | awk '/ROOT\/ubuntu_/{print $1;exit}')
|
||||||
zfs create -o com.ubuntu.zsys:bootfs-datasets=$ROOT_DS \
|
zfs create -o com.ubuntu.zsys:bootfs-datasets=$ROOT_DS \
|
||||||
-o canmount=on -o mountpoint=/home/username \
|
-o canmount=on -o mountpoint=/home/$username \
|
||||||
rpool/USERDATA/username_$UUID
|
rpool/USERDATA/${username}_$UUID
|
||||||
adduser username
|
adduser $username
|
||||||
|
|
||||||
cp -a /etc/skel/. /home/username
|
cp -a /etc/skel/. /home/$username
|
||||||
chown -R username:username /home/username
|
chown -R $username:$username /home/$username
|
||||||
usermod -a -G adm,cdrom,dip,lpadmin,lxd,plugdev,sambashare,sudo username
|
usermod -a -G adm,cdrom,dip,lpadmin,lxd,plugdev,sambashare,sudo $username
|
||||||
|
|
||||||
Step 7: Full Software Installation
|
Step 7: Full Software Installation
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user