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:
- Create a file under
/etc/default/qbee-agent
with the following content:/etc/default/qbee-agentSHELL=/bin/login
- 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:
- Create a script file with the following content: /usr/local/bin/qbee-console
#!/usr/bin/env bash su - qbee
- Make the script executable:
chmod +x /usr/local/bin/qbee-console
- 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