#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2007
    Posts
    313
    Rep Power
    30

    Move ssh known_hosts file


    I was wondering if it's possible to move the known_hosts file from ~/.ssh/known_hosts to ~/somewhere/.ssh/known_hosts .

    I have a server running Plesk and the user home directories do not have write permissions (they do have write permissions within the subfolders, however).

    I was able to move the authorized_keys file by editing sshd_config AuthorizedKeysFile , but when I try to log in without password, I'm still prompted every time if I want to add the host to list of known hosts, and it fails to save every time since it cannot write to known_hosts. Thus I am still unable to automate some processes. I'd like known_hosts to be located in the same location as my authorized_keys, which does have correct permissions for users.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Minneapolis, MN
    Posts
    356
    Rep Power
    12
    This is what's listed in man(5) ssh_config:
    Code:
    UserKnownHostsFile
                 Specifies a file to use for the user host key database instead of
                 ~/.ssh/known_hosts.
    I think that's what you are looking for. You should be able to just set UserKnownHostsFile to ~/somewhere/.ssh/known_hosts in your global ssh_config on that machine.
    badger badger badger badger
    badger badger badger badger
    MUSHROOM MUSHROOM

IMN logo majestic logo threadwatch logo seochat tools logo