Solved

SSH - known_hosts file. User defined.

Posted on 2010-11-23
3
1,521 Views
Last Modified: 2012-06-27
Hello.

command : ssh 192.168.1.10

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

Something like this:

ssh 192.168.1.10 -known_hosts_path=/etc/known_hosts

Is it possible?
0
Comment
Question by:StolenMan
3 Comments
 
LVL 9

Assisted Solution

by:jeremycrussell
jeremycrussell earned 250 total points
ID: 34197326
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.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 34197365
Hi,

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 192.168.1.10

wmp

0
 

Author Closing Comment

by:StolenMan
ID: 34197481
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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,…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

786 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