Setup Example Session
Note:
The
procedure shown in this example assumes that you have a firm
understanding of SSH setup procedures and user and host equivalence
using public private key pair using SSH.$ ssh-keygen -t rsaThe command options instruct the utility to generate SSH keys (RSA key pair).
Generating public/private rsa key pair. Enter file in which to save the key (/home/myhome/.ssh/id_rsa):The path specified is the standard path to the location where SSH keys are stored ($HOME/.ssh).
Enter passphrase (empty for no passphrase)Important: passphrase is not supported for use with SSH keys in named credentials.
Enter same passphrase again: (empty for no passphrase) Your identification has been saved in /home/admin1/.ssh/id_rsa. Your public key has been saved in /home/admin1/.ssh/id_rsa.pub. The key fingerprint is: bb:da:59:7a:fc:24:c6:9a:ee:dd:af:da:1b:1b:ed:7f admin1@myhost2170474The ssh-regkey utility has now generated two files in the .ssh directory.
$ ls id_rsa id_rsa.pubTo permit access to the host without having SSH prompt for a password, copy the public key to the authorized_keys file on that system.
$ cp id_rsa.pub authorized_keysFrom this point, all keys listed in that file are allowed access.
Next, perform a remote logon using SSH. The system will not prompt you for a password.
$ ssh myhost The authenticity of host 'myhost (10.229.147.184)' can't be established. RSA key fingerprint is de:a0:2a:d5:23:f0:8a:72:98:74:2c:6f:bf:ad:5b:2b. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'myhost,10.229.147.184' (RSA) to the list of known hosts. Last login: Mon Aug 29 16:48:45 2012 from anotherhost.example.com $
- From the Setup menu, select Security, then select Named Credentials.
- On the Named Credentials page, click Create. The Create Credential page displays.
- Enter a Credential Name. For example, SSHCRED1.
Note: The SSHCRED1 credential set will be used in Section 13.5.2.2, "Setting Up Host Preferred Credentials Using SSH Key Credentials" - Select Host from the Authenticating Target Type drop-down menu.
- Select SSH Key Credentials from the Credential Type drop-down menu as shown in the following figure.
- Ensure that the SSH private key/public key files have been copied to the host on which the browser is running.
- From the Credential Properties region, click Browse for Public Key and Private Key to upload the generated public key/private key files.
- Click Test and Save to verify the credentials and save them. The new named credential will appear as shown in the following figure.
13.5.2.2 Setting Up Host Preferred Credentials Using SSH Key Credentials
You can set up host preferred credentials to use SSH keys by creating a new credential set that uses the HostSSHCreds credential type. Enterprise Manager administrators then set up preferred credentials that use this credential set. Each Enterprise Manager target type can have one or more preferred credential sets of pre-defined credential types.The following steps use EM CLI to create a host preferred credential set which supports SSH key credentials. This example assumes the existence of the named credential SSHCRED1 of type SSH Key Credentials created in the previous section.
- Log into EM CLI as an Enterprise Manager Super Administrator.
- Create a new credential set of type HostSSHCreds.
$ emcli create_credential_set -set_name=HostSSHCredSet -target_type=host -supported_cred_types=HostSSHCreds Credential set "HostSSHCredSet" created successfully.
Once the credential set is created, Enterprise Manger administrators can set up preferred credentials for this newly created credential set using either EM CLI or the Enterprise Manager console. - Set up Preferred Credentials
for the newly created credential set. You can use EM CLI or the
Enterprise Manger console. The following EM CLI example assumes a named
credential called SSHCRED1 of type SSH Key Credentials has already been
created.
$ emcli set_preferred_credential -target_type=host -target_name=myhost.oracle.com -set_name=HostSSHCredSet -credential_name=SSHCRED1 Successfully set preferred credentials for target myhost.oracle.com:host.
You can now set the preferred credentials of regular regular Enterprise Manager administrators to use the SSHCRED1 named credential by editing/creating an administrator and granting Named Credential resource privileges. The following graphic shows the manage privilege grants UI for named credentials.
Комментариев нет:
Отправить комментарий