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

Kasm-user sudo password

Open abdilea opened this issue 1 year ago • 5 comments

Hi,

I am having issues running sudo for kasm-user for an Ubuntu container. When I try to install a new program I am promoted to a sudo password which I do not have.

I found this https://kasmweb.com/docs/latest/how_to/running_as_root.html#building-a-workspace-with-sudo KB and added kasm-user to the sudoers with no password but still, the issue is persistent.

Can the password be reset for the kasm-user?

abdilea avatar Jan 20 '25 09:01 abdilea

The problem with that page is sudo is already installed in Ubuntu. You want to shorten the JSON you put in the Docker Exec Config to this:

{
  "first_launch": {
    "user": "root",
    "cmd": "bash -c 'echo \"kasm-user  ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers'"
  }
}

Once you do this you will be able to sudo to root without a password.

captbrando avatar Jan 20 '25 15:01 captbrando

Thank You but I am getting this error now.

Image Image

abdilea avatar Jan 29 '25 18:01 abdilea

Once I remove the JSON, it will work fine. Does this need to be done before the first launch?

abdilea avatar Jan 29 '25 18:01 abdilea

There was a bug in the JSON, try the edited version I just pasted.

captbrando avatar Jan 29 '25 18:01 captbrando

The problem with that page is sudo is already installed in Ubuntu. You want to shorten the JSON you put in the Docker Exec Config to this:

{
  "first_launch": {
    "user": "root",
    "cmd": "bash -c 'echo \"kasm-user  ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers'"
  }
}

Once you do this you will be able to sudo to root without a password.

Thank you @captbrando ! I can confirm that this worked perfectly for me.

I was able to start Ubuntu Jammy Desktop and run sudo apt update and it worked.

yottoya avatar Oct 28 '25 20:10 yottoya