Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC Password Authentication #29

Open
lijamez opened this issue Mar 2, 2023 · 3 comments
Open

VNC Password Authentication #29

lijamez opened this issue Mar 2, 2023 · 3 comments
Labels
status:awaiting-triage type:enhancement New feature or request for feature enhancement

Comments

@lijamez
Copy link

lijamez commented Mar 2, 2023

Is your feature request related to a problem?

Sometimes, we need to log into the server to do admin things, such as logging back into Steam in case it decides to log out of the account, restart Steam in case it crashes, etc. noVNC is a reliable and accessible way to manage the server. However, currently anyone on the local network can access the host through noVNC.

What is your feature request?

When VNC is enabled, we should have the option to set a password.

Are there any workarounds?

No response

Additional Context

No response

@lijamez lijamez added status:awaiting-triage type:enhancement New feature or request for feature enhancement labels Mar 2, 2023
@Bortus-AI
Copy link

a password would be nice since my server is hosted in a data center. Anyone with the IP and port can access the web ui

@doodooboi
Copy link

I figured out a workaround to setup a password for the VNC server
Connect through the WebUI and go to Applications > Terminal Emulator

Enter this command into the terminal: sudo nano /usr/bin/start-x11vnc.sh
Edit a portion of the file to include the -passwd flag, example below

Start the x11vnc server

/usr/bin/x11vnc -display ${DISPLAY} -rfbport ${PORT_VNC} -passwd YOUR_PASSWORD -shared -forever&
x11vnc_pid=$!

Now go back to your real machine where the docker container is running, cd into the directory and run
sudo docker compose restart

@janlothar
Copy link

I got a little tired of having to always add that myself whenever the image got updated and the start-x11vnc.sh got scrubbed, so I made a little script designed to be placed in the /home/default/init.d directory. It won't handle weird edge cases, but it's enough until the maintainer (hopefully) adds this as a official feature.

Just make sure that the USER_PASSWORD variable exists or replace that part of the script with your own.

#!/bin/bash

# Define the file path
FILE_PATH="/usr/bin/start-x11vnc.sh"

# Define the password part to insert
PASSWORD_PART="-passwd $USER_PASSWORD"

# Check if the -passwd option is already in the script
if grep -q "\-passwd" "$FILE_PATH"; then
    echo "VNC Password flag already exists."
else
    echo "Adding VNC password flag..."
    # Use sed to insert the password part before the '&' at the end of the command line
    sed -i "/x11vnc.*\&/s/\&/ $PASSWORD_PART&/" "$FILE_PATH"
    echo "VNC Password flag added successfully."
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting-triage type:enhancement New feature or request for feature enhancement
Projects
None yet
Development

No branches or pull requests

4 participants