5 novaboot-shell - provides novaboot with unified SSH-based interface for controlling target hardware
9 B<novaboot-shell> -c "[command [arguments...]]"
11 B<novaboot-shell> [command [arguments...]]
13 B<ssh target@server> [command [arguments...]]
17 B<novaboot-shell> provides L<novaboot(1)> with a unified SSH-based
18 interface for controlling the target hardware. This simplifies
19 client-side configuration, because clients typically need only the
20 I<--ssh=...> option. B<novaboot-shell> is typically configured as a
21 login shell of special user accounts associated with the target
22 hardware (as set by L<adduser-novaboot(8)>). It ensures that users can
23 perform only a limited set of actions (see L</COMMANDS> below) with
24 the target and have no shell access on the server.
32 Connect to target console (usually serial line). When somebody is
33 connected to the console, other users are blocked from controlling the
34 target. Blocked users see a message indicating who blocks them.
36 The user connected to the console is able to invoke other commands
37 such as L</reset>, but only when the command is invoked via the same
38 SSH connection. This can be accomplished by using SSH connection
39 sharing, which is what L<novaboot(1)> uses (see I<-M> and I<-S> in
42 This is the default command when no command is specified on the
43 command line and C<default_cmd> is not set in the configuration file.
47 Reset the target hardware.
51 Power on the target hardware.
55 Power off the target hardware.
59 This command is not meant to be invoked directly by the user. It
60 allows using L<rsync(1)> to copy files to the target, perhaps for TFTP
61 server. The rsync command must be invoked as: C<rsync ...
62 target@server:>, i.e. without specifying destination path. The files
63 will be stored into I<$HOME/tftproot>.
65 =item user <uernamename> [admin]
67 User command is meant to be used with C<command=> option in SSH's
68 L<authorized_keys(5)> file. It allows the shell to display
69 human-readable names when printing information about who blocks the
70 target. Then, the real command is taken from SSH_ORIGINAL_COMMAND
73 When "admin" is specified after the user name, this user is considered
74 an administrator and is allowed to run L</add-key> and L</shell>
79 Prints novaboot configuration options needed for the target. One
84 =head2 Administration commands
86 Only administrators (see L</user>) are allowed to execute these
91 =item add-key <username>
93 Reads the SSH public key from standard input and adds it into in
94 F<~/.ssh/authorized_keys>.
96 Example: C<ssh target@server add-key johndoe < john_rsa.pub>
100 Runs shell on the server. Useful for editing configuration file. It is
101 better used with allocated pseudo-terminal.
103 Example: C<ssh -t target@server shell>
107 =head1 CONFIGURATION FILE
109 B<novaboot-shell> reads configuration file from
110 F<$HOME/.novaboot-shell>. It can define values for the following
111 variables in the shell syntax.
117 Command to C<exec> that connects to target's console.
119 Note that if you need more complex behaviour of the console command,
120 e.g., different behaviour for different users (distinguished by the
121 value of C<$NB_USER> variable), you can set this variable to a name of
122 a shell function, which you define in the configuration file and
123 implement the complex behaviour there.
127 Command to C<exec> that resets the Target.
131 Command to C<exec> that powers the target on.
135 Command to C<exec> that powers the target off. This command is
136 executed either explicitly, when novaboot-shell C<off> command is
137 invoked or automatically, after the last novaboot-shell session
138 finishes and the C<novaboot-delayed-power-off> systemd user service is
143 Novaboot command line options that specify which boot loader is used
144 by the target (L<novaboot(1)> rejects other, possibly dangerous, options).
145 Each option is on its own line and no quoting, escaping or stripping
146 is performed on the values.
152 --uboot-init=setenv serverip 192.168.1.1; setenv ipaddr 192.168.1.10
153 --uboot-addr=kernel=0x8100000
154 --uboot-addr=fdt=0x83000000
155 --uboot-addr=ramdisk=0x83100000
160 If set, this command is executed when no command is specified on the
161 command line. If not set, C<console_cmd> is executed instead.
163 As F<novaboot> (client) always uses the C<console> command to connect
164 to the console, C<default_cmd> can be used to boot the target with
165 some default configuration for users who do not use F<novaboot> client
166 to boot their own configuration.
168 In other words, C<ssh board@host> will boot the board in some default
169 configuration, whereas C<novaboot --ssh=board@host ...> will boot the
170 board as configured in C<...>.
172 Often, it is desired to run F<novaboot> on the server to boot the
173 default configuration. To make this easier to configure, the
174 C<default_cmd> can be set to:
176 run_novaboot <nbscript> [<extra args>...]
178 This command will execute C<novaboot> with the F<\<nbscript>> script
179 as an argument and passes it a few switches with values from the
180 F<$HOME/.novaboot-shell> configuration file. Specifically, it will
181 pass all switches from the C<target_config> variable, C<--reset-cmd>
182 and C<--remote-cmd> switches with the values of C<reset_cmd> and
183 C<console_cmd> variables respectively (see above) and C<--server>
186 Therefore, to boot the default configuration as specified in the
187 F<default_boot> script, it is sufficient to set C<default_cmd> to:
189 run_novaboot ./default_boot --interactive
191 To have different default configuration for different users, one can
192 use the C<$NB_USER> variable as outlined above. The simplest example
193 is perhaps this command:
195 run_novaboot ./default_boot-"$NB_USER" --interactive
199 =head1 AUTOMATIC POWER OFF
201 The target can be automatically powered off when the last session
202 finishes. This can be enabled by running:
204 systemctl --user enable novaboot-delayed-power-off
206 perhaps via the C<shell> subcommand. To enable delayed power-off for
207 all novaboot-shell accounts, run the follwing as root:
209 systemctl --global enable novaboot-delayed-power-off
211 Individual accounts may disable this global configuration by running:
213 systemctl --user mask novaboot-delayed-power-off
215 When C<novaboot-delayed-power-off> is enabled, the I<on> and I<off>
216 commands are executed via systemd rather than by C<novaboot-shell>
217 directly. The delay between the end of the session and power off is
218 hardcoded in the B<novaboot-power-off@.timer> unit. To override the
219 timeout for individual targets, run:
221 systemctl edit novaboot-power-off@TARGET.timer
223 for your B<TARGET> (the user running C<novaboot-shell>) and insert the
224 following to the spawned editor:
231 Michal Sojka <sojkam1@fel.cvut.cz>
233 Latest version can be found at
234 L<https://github.com/wentasah/novaboot>.