Skip to content

How to change user when connecting to a remote console?

When qbee-agent is started, it reads the optional environment file under /etc/default/qbee-agent, so it is possible to change the default remote console behaviour by setting the SHELL variable in this file.

Present a login screen

Setting the SHELL to /bin/login will present the login screen when opening the device's console from qbee.

To do that:

  1. Create a file under /etc/default/qbee-agent with the following content:
    /etc/default/qbee-agent
    SHELL=/bin/login
    
  2. Restart the qbee-agent (see bottom of this page for details).

Authenticate as non-root user

You can also execute a custom scripts that will open a console as a given user.

To do that:

  1. Create a script file with the following content:
    /usr/local/bin/qbee-console
    #!/usr/bin/env bash
    su - qbee
    
  2. Make the script executable:
    chmod +x /usr/local/bin/qbee-console
    
  3. Set the SHELL variable to the script's path:
    /etc/default/qbee-agent
    SHELL=/usr/local/bin/qbee-console
    

When you restart the qbee-agent (see below), this will open the console passwordless for the user 'qbee'.

Restart of qbee-agent is required for changes to take effect

Please remember that qbee-agent will need a restart when setting this env variable, and if you plan to do the restart through qbee itself, you need to run the systemctl command in non-blocking mode:

systemctl --no-block restart qbee-agent