Access remote file via SSH

If your Options file are on a different machine, then follow these instructions if you want to access your remote file via SSH.

Procedure

  1. Log in to the local host as root.
  2. Generate Apache user authorized_keys file.
    #sudo mkdir /var/www/.ssh
    #sudo chown -R apache:nobody /var/www/.ssh
    #sudo -u apache ssh-keygen -t rsa
  3. Copy the generated authorized_keys file to the remote host. A file "authorized_keys" should be created in <remote host name>:/root/.ssh.
    #ssh-copy-id -i /var/www/.ssh/id_rsa <remote host name>
  4. Log in to the remote host and move the authorized_keys file to the Apache user root directory (/var/www/.ssh)
    #sudo mkdir /var/www/.ssh
    #mv /root/.ssh/authorized_keys /var/www/.ssh
    #sudo chown -R apache:nobody /var/www/.ssh
  5. Add or modify Apache user permission on the remote host.
    Note: In the RTM host, Apache user is defined as a nologin user. In the remote host make sure that you can log in as a normal user. Otherwise the SSH remote access will fail.
  6. Verify if we can use Apache user from the local host to access remote file via SSH.
    Log in to the local host and run this command as root:
    #sudo -u apache ssh <remote host name> cat <option file path>