SSH - known_hosts file. User defined.

Posted on 2010-11-23
Last Modified: 2012-06-27

command : ssh

By default ssh client trying to find record with key for host in file ~/.ssh/known_hosts.
How i can specify another path for file with key?

Something like this:

ssh -known_hosts_path=/etc/known_hosts

Is it possible?
Question by:StolenMan

Assisted Solution

jeremycrussell earned 250 total points
Comment Utility
Its an option..

You can specify on command line

ssh -o "UserKnownHostsFile=/path/to/new/file" <system name/ip>

of create a file in the users ~/.ssh directory named ssh_config and put the "UserKnownHostsFile=/path/to/new/file" in that file.
LVL 68

Accepted Solution

woolmilkporc earned 250 total points
Comment Utility

the default for the global known hosts file is /etc/ssh/ssh_known_hosts anyway.

To change that path you can try

ssh -o GlobalKnownHostsFile=/etc/known_hosts



Author Closing Comment

Comment Utility

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now