| 1 |
[[feature-machines]] |
| 2 |
= Multiple Machines |
| 3 |
|
| 4 |
[WARNING] |
| 5 |
==== |
| 6 |
This feature is deprecated as of Cockpit 322. |
| 7 |
==== |
| 8 |
|
| 9 |
Cockpit can connect to multiple machines from a single Cockpit session. |
| 10 |
These are listed in the host switcher. |
| 11 |
|
| 12 |
These additional machines are accessed via SSH from the machine that the |
| 13 |
first machine connected to, and are xref:authentication.adoc[authenticated] |
| 14 |
with the logged in user's password and/or SSH keys. |
| 15 |
|
| 16 |
SSH host keys are stored in `+/etc/ssh/ssh_known_hosts+`. |
| 17 |
|
| 18 |
The machine data is stored in `+/etc/cockpit/machines.d/*.json+`, or |
| 19 |
below `+$XDG_CONFIG_DIRS+` if set (see |
| 20 |
link:./cockpit.conf.5.html[cockpit.conf]). Settings in lexicographically |
| 21 |
later files amend or override settings in earlier ones. Cockpit itself |
| 22 |
writes into `+99-webui.json+`; packages or admins who want to |
| 23 |
pre-configure machines should ship files like `+05-mymachine.json+` so |
| 24 |
that changes from the web interface override the pre-configured files. |
| 25 |
|
| 26 |
Each JSON file contains an object that maps machine IDs to objects that |
| 27 |
define the properties of that machine. The ID can be a human readable |
| 28 |
name or an IP address or any other unique value, and is shown in the web |
| 29 |
interface until connecting to it the first time, at which point the web |
| 30 |
interface will show the machine's host name. |
| 31 |
|
| 32 |
The following properties are recognized: |
| 33 |
|
| 34 |
`+"address"+`:: |
| 35 |
_(string, mandatory)_ IP address or DNS name of the machine |
| 36 |
`+"visible"+`:: |
| 37 |
_(boolean, optional)_ If `+true+`, the machine will be displayed and |
| 38 |
available for managing with Cockpit. If `+false+` (the default), it |
| 39 |
will not be displayed, but still taken into account for type-ahead |
| 40 |
search when adding new machines in the web interface. |
| 41 |
`+"user"+`:: |
| 42 |
_(string, optional)_ User name on the remote machine. When not given, |
| 43 |
Cockpit will default to the user name that was being used to log into |
| 44 |
Cockpit itself. |
| 45 |
`+"port"+`:: |
| 46 |
_(integer, optional)_ ssh port of the remote machine. When not given, |
| 47 |
the default port 22 is used. |
| 48 |
`+"color"+`:: |
| 49 |
_(string, optional)_ Color to assign to the machine label in the web |
| 50 |
interface. This can be either given as |
| 51 |
`+rgb(r_value, g_value, b_value)+` with each value being an integer |
| 52 |
between 0 and 255, or as a color name like `+yellow+`. When not given, |
| 53 |
Cockpit will assign an unused color automatically. |
| 54 |
|
| 55 |
Example: |
| 56 |
|
| 57 |
.... |
| 58 |
{ |
| 59 |
"web server": { |
| 60 |
"address": "192.168.2.4", |
| 61 |
"visible": true, |
| 62 |
"color": "rgb(100, 200, 0)", |
| 63 |
"user": "admin" |
| 64 |
}, |
| 65 |
"192.168.2.1": { |
| 66 |
"address": "192.168.2.1", |
| 67 |
"port": 2222, |
| 68 |
"visible": true, |
| 69 |
"color": "green" |
| 70 |
} |
| 71 |
} |
| 72 |
.... |