mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-25 01:24:04 +01:00
Add rw, ro and owner users on container startup
This commit is contained in:
parent
7a1c1edeb4
commit
e0c056f36b
@ -34,13 +34,31 @@ detect_cert_location() {
|
||||
fi
|
||||
}
|
||||
|
||||
add_vnc_user() {
|
||||
local username="$1"
|
||||
local password="$2"
|
||||
local permission_option="$3"
|
||||
|
||||
echo "Adding user $username"
|
||||
echo -e "$password\n$password" | kasmvncpasswd $permission_option \
|
||||
-u "$username" $HOME/.kasmpasswd
|
||||
}
|
||||
|
||||
## resolve_vnc_connection
|
||||
VNC_IP=$(hostname -i)
|
||||
|
||||
# first entry is control, second is view (if only one is valid for both)
|
||||
mkdir -p "$HOME/.vnc"
|
||||
PASSWD_PATH="$HOME/.vnc/passwd"
|
||||
kasmvncpasswd -w -u $VNC_USER $HOME/.kasmpasswd
|
||||
# echo -e "$VNC_PW\n$VNC_PW" | kasmvncpasswd -w -u $VNC_USER $HOME/.kasmpasswd
|
||||
add_vnc_user "$VNC_USER" "$VNC_PW" "-w"
|
||||
add_vnc_user "$VNC_USER-ro" "$VNC_PW"
|
||||
add_vnc_user "$VNC_USER-owner" "$VNC_PW" "-o"
|
||||
add_vnc_user "$VNC_USER-to-delete" "$VNC_PW"
|
||||
|
||||
kasmvncpasswd -n -u "$VNC_USER-owner" -w $HOME/.kasmpasswd
|
||||
kasmvncpasswd -d -u "$VNC_USER-to-delete" $HOME/.kasmpasswd
|
||||
|
||||
chmod 0600 $HOME/.kasmpasswd
|
||||
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout $HOME/.vnc/self.pem -out $HOME/.vnc/self.pem -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=kasm/emailAddress=none@none.none"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user