workspaces-images icon indicating copy to clipboard operation
workspaces-images copied to clipboard

What is the default password for user "kasm-user"?

Open kevinmnm opened this issue 2 years ago • 3 comments

I stood up Docker container via running docker run --rm -it --shm-size=512m -p 6901:6901 -e VNC_PW=password kasmweb/core-ubuntu-focal:1.14.0 and then I ran docker exec command to directly SSH into the container. Its default user is kasm-user and I can't run sudo command because I don't know its password.

image

kevinmnm avatar Mar 28 '24 21:03 kevinmnm

You can specify the user with docker exec command:

$ docker exec -it -u root CONTAINER_NAME bash
default:~$ id
uid=0(root) gid=0(root) groups=0(root)

You will be able to set kasm-user password then if you want ;)

Booyaabes avatar May 02 '24 15:05 Booyaabes

Using File Mapping to Install and Enable Sudo This example utilizes a feature in Kasm docker images to run a bash script as root after the container starts. This script is located in the image at /dockerstartup/kasm_post_run_root.sh and a custom version can be mapped in using the File Mapping feature. The script used in this example will install the sudo binary and add the kasm-user to the sudoers group. By using the file mapping feature, sudo can be added to any of the existing Kasm Workspaces without having to create a custom image.

Clone the Workspace to be used. Here the Ubuntu Focal workspace has been cloned and named Ubuntu Focal Sudo Desktop. After editing the name and description click Submit.

Click the arrow menu and select Edit and select the File Mapping tab and click Add File Mapping.

Fill in the details of the file to be mapped ensure to mark the file as executable and click Save.

#!/usr/bin/env bash set -ex apt-get update apt-get install -y sudo echo "kasm-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers notify-send "Script Complete" "sudo is now installed"

rtsysEmbedded avatar May 20 '25 10:05 rtsysEmbedded

The concept of Kasm is that users can't install anything in the system. If you want to install packages or applications, you should create your own custom Docker image using a Dockerfile for security reasons. You can then use the RUN command in the Dockerfile to install the necessary packages.

ToonKru3 avatar Aug 05 '25 17:08 ToonKru3