启用安全 shell (SSH) 登录

管理帐户必须能够使用安全 Shell (SSH) 登录 (ssh) 所有主机,而无需指定密码。Shell 脚本 install_vertica 可自动执行此操作。本节说明如何在必要时手动执行该操作。

  1. 如果尚未在所有主机上安装 SSH,则立即以 root 用户身份登录每个主机并安装 SSH。可以从 OpenSSH 下载免费版本的 SSH 连接工具。

  2. 登录到 Vertica 管理员帐户(在此示例中为 dbadmin)。

  3. 将主目录 (~) 设为仅可供您自己写入。选择以下命令之一:

    $ chmod 700 ~
    

    $ chmod 755 ~
    

    其中:

  4. 更改至主目录:

    $ cd ~
    
  5. 生成私钥/公钥对:

    $ ssh-keygen -t rsaGenerating public/private rsa key pair.
    Enter file in which to save the key (/home/dbadmin/.ssh/id_rsa):
    Created directory '/home/dbadmin/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/dbadmin/.ssh/id_rsa.
    Your public key has been saved in /home/dbadmin/.ssh/id_rsa.pub.
    
  6. 将 .ssh 目录设为仅可供您自己读取和写入:

    $ chmod 700 ~/.ssh
    
  7. 更改至 .ssh 目录:

    $ cd ~/.ssh
    
  8. 将文件 id_rsa.pub 复制到文件 authorized_keys2

    $ cp id_rsa.pub authorized_keys2
    
  9. 将 .ssh 目录中的文件设为仅可供您自己读取和写入:

    $ chmod 600 ~/.ssh/*
    
  10. 对于每个群集主机:

    $ scp -r ~/.ssh <host>:.
    
  11. 连接到每个群集主机。首次通过 ssh 连接到新的远程计算机时,可能收到与以下类似的消息:

    $ ssh dev0 Warning: Permanently added 'dev0,192.168.1.92' (RSA) to the list of known hosts.
    

    仅在首次通过 ssh 连接到特定远程主机时显示此消息。

另请参阅