adding new build
This commit is contained in:
parent
7f6d04cb3d
commit
f9856c17fc
6 changed files with 108 additions and 90 deletions
37
debian-mate/root/etc/cont-init.d/60-create-user
Executable file
37
debian-mate/root/etc/cont-init.d/60-create-user
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
|
||||
echo "**** create ${USERNAME} user and make our folders ****" && \
|
||||
useradd -u 912 -U -d /home/${USERNAME} -s /bin/bash ${USERNAME}
|
||||
usermod -G users,sudo ${USERNAME}
|
||||
echo "${USERNAME}:${PASSWORD}" | chpasswd
|
||||
mkdir -p /home/${USERNAME}
|
||||
chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
|
||||
|
||||
chmod 755 /etc
|
||||
chmod 755 /etc/xrdp
|
||||
chmod 755 /etc/xrdp/sesman.ini
|
||||
|
||||
touch /home/${USERNAME}/lock.file
|
||||
|
||||
# create .config dir
|
||||
[[ ! -d /home/${USERNAME}/.config ]] && \
|
||||
mkdir -p /home/${USERNAME}/.config
|
||||
|
||||
|
||||
cp /defaults/startwm.sh /home/${USERNAME}/startwm.sh
|
||||
chmod +x /home/${USERNAME}/startwm.sh
|
||||
chown -R ${USERNAME}:${USERAME} /home/${USERNAME}
|
||||
|
||||
# permissions
|
||||
PERM=$(stat -c '%U' /home/${USERNAME}/.config)
|
||||
[[ "${PERM}" != "${USERNAME}" ]] && \
|
||||
chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
|
||||
|
||||
|
||||
# set random password for abc user to prevent it from connecting
|
||||
|
||||
RANDOM_PASS=`tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo ''`
|
||||
|
||||
echo abc:${RANDOM_PASS} | chpasswd
|
||||
usermod -s /bin/false abc
|
||||
Loading…
Add table
Add a link
Reference in a new issue