Vinay Vishal | 7c4c4fc | 2019-01-28 12:01:04 +0530 | [diff] [blame] | 1 | type=page |
| 2 | status=published |
| 3 | title=setup-ssh |
| 4 | next=set-web-context-param.html |
| 5 | prev=setup-local-dcom.html |
| 6 | ~~~~~~ |
| 7 | setup-ssh |
| 8 | ========= |
| 9 | |
| 10 | [[setup-ssh-1]][[GSRFM00229]][[setup-ssh]] |
| 11 | |
| 12 | setup-ssh |
| 13 | --------- |
| 14 | |
| 15 | sets up an SSH key on specified hosts |
| 16 | |
| 17 | [[sthref2074]] |
| 18 | |
| 19 | Synopsis |
| 20 | |
| 21 | [source,oac_no_warn] |
| 22 | ---- |
| 23 | asadmin [asadmin-options] setup-ssh [--help] |
| 24 | [--sshport ssh-port] [--sshuser ssh-user] |
| 25 | [--sshkeyfile ssh-keyfile] [--sshpublickeyfile ssh-public-keyfile] |
| 26 | [--generatekey={false|true}] |
| 27 | host-list |
| 28 | ---- |
| 29 | |
| 30 | [[sthref2075]] |
| 31 | |
| 32 | Description |
| 33 | |
| 34 | The `setup-ssh` subcommand sets up a secure shell (SSH) key on the hosts |
| 35 | that are specified as the operand of the subcommand. This key enables |
| 36 | \{product---name} to use public-key authentication for authentication of |
| 37 | the user's SSH login on remote hosts. |
| 38 | |
| 39 | SSH ensures that \{product---name} clusters that span multiple hosts can |
| 40 | be administered centrally. When a user runs a subcommand for cluster |
| 41 | administration that acts on multiple hosts, the subcommand is propagated |
| 42 | from the domain administration server (DAS) host to remote hosts. To |
| 43 | propagate subcommands that act on a \{product---name} instance that is |
| 44 | not running, or on a node where no instances are running, |
| 45 | \{product---name} uses SSH. SSH provides confidentiality and security |
| 46 | for data that is exchanged between the DAS and remote hosts. |
| 47 | |
| 48 | Public-key authentication uses an SSH key pair that comprises the |
| 49 | following keys: |
| 50 | |
| 51 | * A private key, which is stored in a secure location on the DAS host |
| 52 | and which may be protected with a passphrase |
| 53 | * The public key, which is stored on all the remote hosts with which the |
| 54 | DAS communicates |
| 55 | |
| 56 | The subcommand does not require any configuration information from the |
| 57 | DAS and does not modify the configuration of the DAS. |
| 58 | |
| 59 | This subcommand is supported in local mode only. |
| 60 | |
| 61 | Prerequisites for Using the `setup-ssh` Subcommand |
| 62 | |
| 63 | To use the `setup-ssh` subcommand, the SSH user must be able to use SSH |
| 64 | to log in to remote hosts where SSH is to be set up. Specifically, the |
| 65 | following prerequisites must be met: |
| 66 | |
| 67 | * The |
| 68 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ssh-1[`ssh`(1)] |
| 69 | client is installed on the DAS host and is accessible through the DAS |
| 70 | user's path. |
| 71 | * The |
| 72 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1Msshd-1m[`sshd`(1M)] |
| 73 | daemon is installed and running on all hosts where an SSH key is to be |
| 74 | set up. |
| 75 | * The user that the `--sshuser` option specifies has an SSH login on all |
| 76 | hosts where an SSH key is to be set up. |
| 77 | * The |
| 78 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ssh-keygen-1[`ssh-keygen`(1)] |
| 79 | utility is installed on the DAS host either at the default location or |
| 80 | in a location that is defined in the DAS user's path. |
| 81 | * On Windows systems, the SSH package for http://www.cygwin.com/[Cygwin] |
| 82 | (http://www.cygwin.com/) or an http://www.mkssoftware.com/[MKS Software] |
| 83 | (http://www.mkssoftware.com/) toolkit that provides SSH is installed. |
| 84 | |
| 85 | Behavior of the `setup-ssh` Subcommand |
| 86 | |
| 87 | The subcommand sets up SSH connectivity between the DAS host and remote |
| 88 | hosts by automating the following tasks: |
| 89 | |
| 90 | * Generating an SSH key pair. If no SSH key pair exists, the default |
| 91 | behavior of the subcommand is to prompt the user to generate an SSH key |
| 92 | pair. The SSH key pair is generated without an encryption passphrase. If |
| 93 | a passphrase-protected key pair is required, the key pair must be |
| 94 | generated manually by using the SSH |
| 95 | commandhttp://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ssh-keygen-1[`ssh-keygen`(1)]. |
| 96 | * Distributing the public key. The subcommand appends the content of the |
| 97 | public key file to the user-home`/.ssh/authorized_keys` file on each |
| 98 | remote host. By default, the subcommand locates the public key file in |
| 99 | the user-home`/.ssh` directory on the host where the subcommand is run. |
| 100 | If the user-home`/.ssh/authorized_keys` file does not exist on a host, |
| 101 | the subcommand creates the file. user-home is the user's home directory |
| 102 | on a host. + |
| 103 | To distribute the public key, authentication of the user's SSH login is |
| 104 | required. If the private key is protected by a passphrase, the |
| 105 | passphrase is also required. By default, the subcommand prompts the user |
| 106 | for the password and, if necessary, the passphrase. To distribute the |
| 107 | public key without being prompted, run the subcommand as follows: |
| 108 | |
| 109 | ** Set the `--interactive` option of the |
| 110 | link:asadmin.html#asadmin-1m[`asadmin`(1M)] utility to `false`. |
| 111 | |
| 112 | ** Set the `--passwordfile` option of the `asadmin` utility to a file in |
| 113 | which the `AS_ADMIN_SSHPASSWORD` entry specifies the SSH user's password |
| 114 | for logging in to the specified hosts. |
| 115 | |
| 116 | ** If a passphrase is required, ensure that the file that |
| 117 | `--passwordfile` option of the `asadmin` utility specifies also contains |
| 118 | an entry for `AS_ADMIN_SSHKEYPASSPHRASE`. + |
| 119 | If public key authentication is already set up on a host, the subcommand |
| 120 | informs the user that public key authentication is already set up and |
| 121 | does not distribute the key to the host. |
| 122 | |
| 123 | [[sthref2076]] |
| 124 | |
| 125 | Options |
| 126 | |
| 127 | asadmin-options:: |
| 128 | Options for the `asadmin` utility. For information about these |
| 129 | options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page. |
| 130 | `--help`:: |
| 131 | `-?`:: |
| 132 | Displays the help text for the subcommand. |
| 133 | `--sshport`:: |
| 134 | The port to use for SSH connections to the host where SSH is being set |
| 135 | up. The default is 22. |
| 136 | `--sshuser`:: |
| 137 | The SSH user on the remote host that is to run the process for setting |
| 138 | up SSH on that host. The default is the user that is running this |
| 139 | subcommand. To ensure that the DAS can read this user's SSH private |
| 140 | key file, specify the user that is running the DAS process. |
| 141 | `--sshkeyfile`:: |
| 142 | The absolute path to the SSH private key file for user that the |
| 143 | `--sshuser` option specifies. This file is used for authentication to |
| 144 | the `sshd` daemon on the host. + |
| 145 | The user that is running this subcommand must be able to reach the |
| 146 | path to the key file and read the key file. + |
| 147 | The default is a key file in the user's `.ssh` directory on the host |
| 148 | where the subcommand is run. If multiple key files are found, the |
| 149 | subcommand uses the following order of preference: + |
| 150 | 1. `id_rsa` |
| 151 | 2. `id_dsa` |
| 152 | 3. `identity` |
| 153 | `--sshpublickeyfile`:: |
| 154 | The absolute path to the SSH public key file for user that the |
| 155 | `--sshuser` option specifies. The content of the public key file is |
| 156 | appended to the user's `.ssh/authorized_keys` file on each host where |
| 157 | SSH is being set up. If the `.ssh/authorized_keys` file does not exist |
| 158 | on a host, the subcommand creates the file. + |
| 159 | The user that is running this subcommand must be able to reach the |
| 160 | path to the key file and read the key file. + |
| 161 | The default is a key file in the user's `.ssh` directory on the host |
| 162 | where the subcommand is run. If multiple key files are found, the |
| 163 | subcommand uses the following order of preference: + |
| 164 | 1. `id_rsa.pub` |
| 165 | 2. `id_dsa.pub` |
| 166 | 3. `identity.pub` |
| 167 | `--generatekey`:: |
| 168 | Specifies whether the subcommand generates the SSH key files without |
| 169 | prompting the user. + |
| 170 | Possible values are as follows: + |
| 171 | `true`;; |
| 172 | The subcommand generates the SSH key files without prompting the |
| 173 | user. |
| 174 | `false`;; |
| 175 | The behavior of the subcommand depends on whether the SSH key files |
| 176 | exist: + |
| 177 | * If the SSH key files exist, the subcommand does not generate the |
| 178 | files. |
| 179 | * If the SSH key files do not exist, the behavior of the subcommand |
| 180 | depends on the value of the `--interactive` option of the `asadmin` |
| 181 | utility: |
| 182 | ** If the `--interactive` option is `true`, the subcommand prompts |
| 183 | the user to create the files. |
| 184 | ** If the `--interactive` option is `false`, the subcommand fails. + |
| 185 | This value is the default. |
| 186 | |
| 187 | [[sthref2077]] |
| 188 | |
| 189 | Operands |
| 190 | |
| 191 | host-list:: |
| 192 | A space-separated list of the names of the hosts where an SSH key is |
| 193 | to be set up. |
| 194 | |
| 195 | [[sthref2078]] |
| 196 | |
| 197 | Examples |
| 198 | |
| 199 | [[GSRFM751]][[sthref2079]] |
| 200 | |
| 201 | Example 1 Setting Up an SSH Key |
| 202 | |
| 203 | This example sets up an SSH key for the user `gfuser` on the hosts |
| 204 | `sj03` and `sj04`. The key file is not generated but is copied from the |
| 205 | user's `.ssh` directory on the host where the subcommand is running. |
| 206 | |
| 207 | [source,oac_no_warn] |
| 208 | ---- |
| 209 | asadmin> setup-ssh sj03 sj04 |
| 210 | Enter SSH password for gfuser@sj03> |
| 211 | Copied keyfile /home/gfuser/.ssh/id_rsa.pub to gfuser@sj03 |
| 212 | Successfully connected to gfuser@sj03 using keyfile /home/gfuser/.ssh/id_rsa |
| 213 | Copied keyfile /home/gfuser/.ssh/id_rsa.pub to gfuser@sj04 |
| 214 | Successfully connected to gfuser@sj04 using keyfile /home/gfuser/.ssh/id_rsa |
| 215 | Command setup-ssh executed successfully. |
| 216 | ---- |
| 217 | |
| 218 | [[GSRFM752]][[sthref2080]] |
| 219 | |
| 220 | Example 2 Generating and Setting Up an SSH Key |
| 221 | |
| 222 | This example generates and sets up an SSH key for the user `gfuser` on |
| 223 | the hosts `sua01` and `sua02`. |
| 224 | |
| 225 | [source,oac_no_warn] |
| 226 | ---- |
| 227 | asadmin> setup-ssh --generatekey=true sua01 sua02 |
| 228 | Enter SSH password for gfuser@sua01> |
| 229 | Created directory /home/gfuser/.ssh |
| 230 | /usr/bin/ssh-keygen successfully generated the identification /home/gfuser/.ssh/id_rsa |
| 231 | Copied keyfile /home/gfuser/.ssh/id_rsa.pub to gfuser@sua01 |
| 232 | Successfully connected to gfuser@sua01 using keyfile /home/gfuser/.ssh/id_rsa |
| 233 | Copied keyfile /home/gfuser/.ssh/id_rsa.pub to gfuser@sua02 |
| 234 | Successfully connected to gfuser@sua02 using keyfile /home/gfuser/.ssh/id_rsa |
| 235 | Command setup-ssh executed successfully. |
| 236 | ---- |
| 237 | |
| 238 | [[sthref2081]] |
| 239 | |
| 240 | Exit Status |
| 241 | |
| 242 | 0:: |
| 243 | command executed successfully |
| 244 | 1:: |
| 245 | error in executing the command |
| 246 | |
| 247 | [[sthref2082]] |
| 248 | |
| 249 | See Also |
| 250 | |
| 251 | link:asadmin.html#asadmin-1m[`asadmin`(1M)] |
| 252 | |
| 253 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ssh-1[`ssh`(1)], |
| 254 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ssh-keygen-1[`ssh-keygen`(1)] |
| 255 | |
| 256 | http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1Msshd-1m[`sshd`(1M)] |
| 257 | |
| 258 | Cygwin Information and Installation (`http://www.cygwin.com/`), MKS |
| 259 | Software (`http://www.mkssoftware.com/`) |
| 260 | |
| 261 | |