このドキュメントで説明するソフトウェアは、Extended SupportまたはSustaining Supportのいずれかにあります。 詳細は、https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdfを参照してください。
Oracleでは、このドキュメントに記載されているソフトウェアをできるだけ早くアップグレードすることをお薦めします。
OpenSSHユーティリティを使用して、リモート・システムに接続するたびにパスワードを指定せずにアクセスする手順は、次のとおりです。
ssh-keygenを使用して、次の例のように公開キーと秘密キーのペアを生成します。
$
ssh-keygenGenerating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa):<Enter>Created directory '/home/user/.ssh'. Enter passphrase (empty for no passphrase):<Enter>Enter same passphrase again:<Enter>...このコマンドによってパスフレーズの入力が求められるたびに、
[Enter]を押します。ssh-copy-idスクリプトを使用して、次の例のように
~/.ssh/id_rsa.pubファイルの公開キーをリモート・システムの~/.ssh/authorized_keysファイルに追加します。$
ssh-copy-idremote_user@hostremote_user@host's password:Now try logging into the machine, with "ssh 'remote_passwordremote_user@host'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.プロンプトが表示されたら、リモート・システムのパスワードを入力します。
このスクリプトは、リモート・システムの
~/.sshおよび~/.ssh/authorized_keysの権限も変更して、ユーザーのグループによるアクセスを禁止します。これで、OpenSSHユーティリティを使用して、リモート・システムにパスワードを指定せずにアクセスできます。 スクリプトの表示に従って、sshを使用してリモート・システムにログインし、
~/.ssh/authorized_keysファイルに接続元のシステムのキーのみが含まれていることを確認します。 次に例を示します。$
sshremote_user@hostLast login: Thu Jun 13 08:33:58 2013 fromlocal_hosthost$cat .ssh/authorized_keysssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6OabJhWABsZ4F3mcjEPT3sxnXx1OoUcvuCiM6fg5s/ER ... FF488hBOk2ebpo38fHPPK1/rsOEKX9Kp9QWH+IfASI8q09xQ==local_user@local_hosthost$logoutConnection tohostclosed. $リモート
~/.sshディレクトリおよび~/.ssh/authorized_keysファイルのアクセス権限がユーザーのみに許可されていることを確認します。$
sshtotal 4 drwx------+ 2remote_user@hostls -al .sshremote_usergroup5 Jun 12 08:33 . drwxr-xr-x+ 3remote_usergroup9 Jun 12 08:32 .. -rw-------+ 1remote_usergroup397 Jun 12 08:33 authorized_keys $ssh# file: .ssh # owner:remote_user@hostgetfacl .sshremote_user# group:groupuser::rwx group::--- mask::rwx other::--- $ssh# file: .ssh/authorized_keys # owner:remote_user@hostgetfacl .ssh/authorized_keysremote_user# group:groupuser::rw- group::--- mask::rwx other::---必要に応じて、権限を変更してください。
$
ssh$remote_user@host'umask 077; /sbin/restorecon .ssh'sshremote_user@host'umask 077; /sbin/restorecon .ssh/authorized_keys'ノートユーザー名がクライアント・システムとサーバー・システムで同じ場合は、リモート・ユーザー名と
@記号を指定する必要はありません。ユーザー名がクライアント・システムとサーバー・システムで異なる場合は、次の例のようにローカル・ユーザー名を定義する、権限が600の
~/.ssh/configファイルをリモート・システムに作成します。$
ssh$remote_user@hostecho -e "Host *\\\nUserlocal_user" '>>' .ssh/configsshHost * Userremote_user@hostcat .ssh/configlocal_user$sshremote_user@host'umask 077; /sbin/restorecon .ssh/config'これで、次の例のようにリモート・ユーザー名の指定が不要のリモート・システムへのアクセスが可能になります。
$
ssh-rw-------+ 1hostls -l .ssh/configremote_usergroup37 Jun 12 08:34 .ssh/config $ssh# file: .ssh/config # owner:hostgetfacl .ssh/configremote_user# group:groupuser::rw- group::--- mask::rwx other::---
詳細は、ssh-copy-id(1)、ssh-keygen(1)およびssh_config(5)の各マニュアル・ページを参照してください。

