|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing/installing_sno/install-sno-installing-sno.adoc |
| 4 | + |
| 5 | +:_module-type: PROCEDURE |
| 6 | +[id="create-custom-live-rhcos-iso_{context}"] |
| 7 | += Creating a custom live {op-system} ISO for remote server access |
| 8 | + |
| 9 | +In some cases, you cannot attach an external disk drive to a server, however, you need to access the server remotely to provision a node. |
| 10 | +It is recommended to enable SSH access to the server. |
| 11 | +You can create a live {op-system} ISO with SSHd enabled and with predefined credentials so that you can access the server after it boots. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You installed the `butane` utility. |
| 16 | +
|
| 17 | +.Procedure |
| 18 | + |
| 19 | +. Download the `coreos-installer` binary from the `coreos-installer` image link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[mirror] page. |
| 20 | + |
| 21 | +. Download the latest live {op-system} ISO from link:https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/latest/rhcos-live.x86_64.iso[mirror.openshift.com]. |
| 22 | + |
| 23 | +. Create the `embedded.yaml` file that the `butane` utility uses to create the Ignition file: |
| 24 | ++ |
| 25 | +[source,yaml] |
| 26 | +---- |
| 27 | +variant: rhcos |
| 28 | +version: 0.1.0 |
| 29 | +passwd: |
| 30 | + users: |
| 31 | + - name: root |
| 32 | + ssh_authorized_keys: |
| 33 | + - '<ssh_key>' |
| 34 | + password_hash: '$2b$05$aAd9TkvWnvUmeDQEA9vkiOoCqCZgd6cWn0xXwe.ii/TqeCxUC0Z0G' <1> |
| 35 | +storage: |
| 36 | + files: |
| 37 | + - path: /etc/ssh/sshd_config |
| 38 | + contents: |
| 39 | + local: ./live-sshd_config |
| 40 | + mode: 0600 |
| 41 | + overwrite: true |
| 42 | +---- |
| 43 | +<1> `yescrypt` passwords are not supported in {op-system}. Use `bcrypt` instead when you create the `password_hash`. |
| 44 | + |
| 45 | +. Create the `files-dir/` folder and copy the default `sshd_config` file into the folder. |
| 46 | + |
| 47 | +. Update the following fields in the `files-dir/sshd_config` file: |
| 48 | ++ |
| 49 | +[source,bash] |
| 50 | +---- |
| 51 | +[...] |
| 52 | +PermitRootLogin yes <1> |
| 53 | +[...] |
| 54 | +PasswordAuthentication yes <2> |
| 55 | +---- |
| 56 | +<1> Allows access to the server as a root user. |
| 57 | +<2> Allows access to the server by using a password. |
| 58 | + |
| 59 | ++ |
| 60 | +[IMPORTANT] |
| 61 | +==== |
| 62 | +The modified `sshd_config` file overrides the default `sshd_config` file. |
| 63 | +==== |
| 64 | + |
| 65 | +. Pass the YAML file and the folder to the `butane` utility: |
| 66 | ++ |
| 67 | +[source,terminal] |
| 68 | +---- |
| 69 | +$ butane -p embedded.yaml -d files-dir/ > embedded.ign |
| 70 | +---- |
| 71 | + |
| 72 | +. Once the Ignition file is created, you can include the configuration in a new live {op-system} ISO, which is named `rhcos-sshd-4.11.0-x86_64-live.x86_64.iso`, with the `coreos-installer` utility: |
| 73 | ++ |
| 74 | +[source,terminal] |
| 75 | +---- |
| 76 | +$ coreos-installer iso ignition embed -i embedded.ign rhcos-4.11.0-x86_64-live.x86_64.iso -o rhcos-sshd-4.11.0-x86_64-live.x86_64.iso |
| 77 | +---- |
| 78 | + |
| 79 | +.Verification |
| 80 | + |
| 81 | +. Check that the custom live ISO can be used to boot the server by running the following command: |
| 82 | ++ |
| 83 | +[source,terminal] |
| 84 | +---- |
| 85 | +# coreos-installer iso ignition show rhcos-sshd-4.11.0-x86_64-live.x86_64.iso |
| 86 | +---- |
| 87 | + |
| 88 | ++ |
| 89 | +.Example output |
| 90 | +[source,json] |
| 91 | +---- |
| 92 | +{ |
| 93 | + "ignition": { |
| 94 | + "version": "3.2.0" |
| 95 | + }, |
| 96 | + "passwd": { |
| 97 | + "users": [ |
| 98 | + { |
| 99 | + "name": "root", |
| 100 | + "passwordHash": "$2b$05$aAd9TkvWnvUmeDQEA9vkiOoCqCZgd6cWn0xXwe.ii/TqeCxUC0Z0G", |
| 101 | + "sshAuthorizedKeys": [ |
| 102 | + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCZnG8AIzlDAhpyENpK2qKiTT8EbRWOrz7NXjRzopbPu215mocaJgjjwJjh1cYhgPhpAp6M/ttTk7I4OI7g4588Apx4bwJep6oWTU35LkY8ZxkGVPAJL8kVlTdKQviDv3XX12l4QfnDom4tm4gVbRH0gNT1wzhnLP+LKYm2Ohr9D7p9NBnAdro6k++XWgkDeijLRUTwdEyWunIdW1f8G0Mg8Y1Xzr13BUo3+8aey7HLKJMDtobkz/C8ESYA/f7HJc5FxF0XbapWWovSSDJrr9OmlL9f4TfE+cQk3s+eoKiz2bgNPRgEEwihVbGsCN4grA+RzLCAOpec+2dTJrQvFqsD [email protected]" |
| 103 | + ] |
| 104 | + } |
| 105 | + ] |
| 106 | + }, |
| 107 | + "storage": { |
| 108 | + "files": [ |
| 109 | + { |
| 110 | + "overwrite": true, |
| 111 | + "path": "/etc/ssh/sshd_config", |
| 112 | + "contents": { |
| 113 | + "compression": "gzip", |
| 114 | + "source": "data:;base64,H4sIAAAAAAAC/4RXX2/bOBJ/16eYWy2QFoj/pdtDN8A9qI6SGLEdw3b22qeAlsY21xQpkJQd3cN99sUMZcUuvFsXbUXO8Mf5P8MYwu/X5xL118XdLTi3zV8zo9dyc72HQXfQ/wQ3/cGXXv+3Xv93uOnf/ja4vbkB/yekbyX8GkUxLLfSgXTgt8jnwaHdowVXO49F5yBzhABZWeGl0bCWCrsAC8QoPr3yw+ePsDYWCmMRpF4bW/CBbnsN4x+Eg8wUpVSYw0H6LcyS5eN/epWzPWUyoXorqW952X6Efdeu6SugIjhvhcdNDZXDnAUwJV3rQGrWKse1qJQ/FRXcVpZlc38UA1lwsXhkOxhwJWZyXbc4LKTforQt1l6oCuGwRUtGKI1zcqXwGlaVB4Vij8RfkJ4Fao95F+BFt6sW2ezRWrKw3xLOGTqbbbSG2lRwENqTZNlW6A1zQ2msB6NBwCIdS129NR675gNbFsGAR6WiuGURK1N58OSLANU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] |
| 119 | + } |
| 120 | +} |
| 121 | +---- |
0 commit comments