From ef3100e9637adda26fa19e7ee8606788320dcde3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 24 Aug 2015 22:44:54 +0200 Subject: machinectl: extend the "shell" syntax to take user@container names In order to make "machinectl shell" more similar to ssh, allow the following syntax to connect to a container under a specific username: machinectl shell lennart@fedora Also beefs up related man page documentation. --- man/machinectl.xml | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'man/machinectl.xml') diff --git a/man/machinectl.xml b/man/machinectl.xml index 2f68f91b93..6cf405ed29 100644 --- a/man/machinectl.xml +++ b/man/machinectl.xml @@ -403,7 +403,7 @@ - shell [NAME [PATH [ARGUMENTS...]]] + shell [[NAME@]NAME [PATH [ARGUMENTS...]]] Open an interactive shell session in a container or on the local host. The first argument refers to @@ -415,10 +415,29 @@ immediately invokes a user process. This command runs the specified executable with the specified arguments, or /bin/sh if none is specified. By default - opens a root shell, but using - a different user may be selected. Use - to set environment variables for - the executed process. + opens a root shell, but by using + , or by prefixing the machine name with + a username and an @ character, a different + user may be selected. Use to set + environment variables for the executed process. + + When using the shell command without + arguments (thus invoking the executed shell or command on the + local host) it is similar in many ways to a su1 + session, but unlike su completely isolates + the new session from the originating session, so that it + shares no process or session properties, and is in a clean and + well-defined state. It will be tracked in a new utmp, login, + audit and keyring session, and will not inherit an environment + variables or resource limits, among other properties. + + Note that the + systemd-run1 + may be used in place of the shell command, + and allows more detailed, low-level configuration of the + invoked unit. However, it is frequently more privileged than + the shell command. @@ -995,6 +1014,17 @@ current directory. + + Create a new shell session + + # machinectl shell --uid=lennart + + This creates a new shell session on the local host, for + the user ID lennart, in a su1-like + fashion. + + -- cgit v1.2.3-54-g00ecf