How to clear /.ssh/known_hosts for chrome extension.

19,897 views
Skip to first unread message

vps...@gmail.com

unread,
Jul 23, 2013, 7:34:14 AM7/23/13
to chromiu...@chromium.org
Actually one of my server is formatted. After that server is not accessible from my chrome. Need to remove the entry from /.ssh/known_hosts. I am familiar with this but I am not getting the exact location of this file in my PC. I am using windows 7 professional. If it was Linux box then easily I can. Tell me where it is exactly located.

Thanks in advance.. :D

vishnu 

Robert Ginda

unread,
Jul 23, 2013, 2:32:02 PM7/23/13
to vps...@gmail.com, chromium-hterm


--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/18f1ee4f-b334-4c88-b66f-4bd9a1e30e74%40chromium.org.
 
 

jrpdu...@gmail.com

unread,
Sep 2, 2015, 3:05:17 PM9/2/15
to chromium-hterm, vps...@gmail.com
I have the same requiremtn but cannot find answer. could you share your answer ?

jrpdu...@gmail.com

unread,
Sep 2, 2015, 3:08:37 PM9/2/15
to chromium-hterm, vps...@gmail.com
From https://github.com/libapps/libapps-mirror/blob/master/nassh/doc/faq.txt#L460:

  If you know the index of the offending host entry (it's usually reported
  by ssh if the connection fails) you can open the JavaScript console and
  type...

     term_.command.removeKnownHostByIndex(index)

  Replace index with the numeric, one-based host index.

  If you don't know the index, or you'd like to clear all known hosts,
  type...

     term_.command.removeAllKnownHosts()

On Tuesday, July 23, 2013 at 4:34:14 AM UTC-7, vps...@gmail.com wrote:

michael...@gmail.com

unread,
Apr 12, 2016, 3:53:37 AM4/12/16
to chromium-hterm, vps...@gmail.com, jrpdu...@gmail.com
And how do you "Open the JavaScript console?"

Jim Tittsler

unread,
Apr 12, 2016, 4:22:24 AM4/12/16
to michael...@gmail.com, chromium-hterm
On Tue, Apr 12, 2016 at 4:53 PM, <michael...@gmail.com> wrote:
> And how do you "Open the JavaScript console?"

Control-Shift-J (or on OS X, I think it is Command-Option-J)

davecc...@gmail.com

unread,
Apr 23, 2016, 8:22:46 PM4/23/16
to chromium-hterm, michael...@gmail.com
what about chromebook?

Jim Tittsler

unread,
Apr 23, 2016, 9:39:34 PM4/23/16
to davecc...@gmail.com, chromium-hterm
Control-Shift-J
> --
> You received this message because you are subscribed to the Google Groups
> "chromium-hterm" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chromium-hter...@chromium.org.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/8c2a14ae-667f-4500-949e-5cdc67466300%40chromium.org.

davecc...@gmail.com

unread,
Apr 24, 2016, 9:23:20 AM4/24/16
to chromium-hterm, davecc...@gmail.com
CTRL-SHIFT-I seemed to work for me (developer tools), then just choose the Console tab.

by the way, to use a command like:

term_.command.removeAllKnownHosts()

it must be done in the same browser window as the terminal is running in - it won't work in just any browser window (not global or whatever).

when done in the browser session i was having the key issue, it worked perfectly:

> term_.command.removeAllKnownHosts()
> true

and then i could connect, getting the authenticity prompt i was hoping for.

glyn....@gmail.com

unread,
May 26, 2016, 6:16:26 AM5/26/16
to chromium-hterm, davecc...@gmail.com
I have opened the terminal in the same window as the secure shell. When I run term_.command.removeAllKnownHosts() I get error:

VM300:1 Uncaught ReferenceError: term_ is not defined(…)

Sorry, what am I missing? This has worked in the past for me. 

Robert Ginda

unread,
May 26, 2016, 12:24:22 PM5/26/16
to glyn....@gmail.com, chromium-hterm, davecc...@gmail.com
The JS Console is associated with the window it was opened from, so you need to opened it from a Secure Shell window in order to see the Secure Shell term_ variable.

rbd...@gmail.com

unread,
Jun 13, 2016, 9:42:32 PM6/13/16
to chromium-hterm, glyn....@gmail.com, davecc...@gmail.com
You need to initiate the connection and get the error message about hostkey. That is when you open the console and run the command. (If you open console from the connection selection screen it won't work)

glyn....@gmail.com

unread,
Jun 22, 2016, 8:28:55 PM6/22/16
to chromium-hterm, glyn....@gmail.com, davecc...@gmail.com, rbd...@gmail.com
>You need to initiate the connection and get the error message about hostkey. That is when you open the console and run the command. (If you open console from the connection selection screen it won't work

Thanks for your help. Yes, this is exactly what I'm going. I wait until I get the error then I Ctrl + Shift + J to open up the console and still get Uncaught ReferenceError: term_ is not defined(…) error :-(

This is really frustrating, I really want to use SSH terminal but without anyway to clear the keys it's impractical since I develop using lots of different Raspberry Pi's on the  same network / IP

Screenshot 2016-06-23 at 01.25.07.png

Nathan McSween

unread,
Jun 22, 2016, 8:53:41 PM6/22/16
to glyn....@gmail.com, chromium-hterm, davecc...@gmail.com, rbd...@gmail.com

+1 on the issue raised by Glyn.hudson


Mike Frysinger

unread,
Jun 22, 2016, 10:53:34 PM6/22/16
to glyn....@gmail.com, chromium-hterm, davecc...@gmail.com, rbd...@gmail.com
you don't need to connect.  simply load the console when at the connection screen.  i just tried it and it worked for me.

if term_ is undefined, try loading a second window, or refreshing the current one (ctrl+r).
-mike

max.lau...@gmail.com

unread,
Jun 25, 2016, 3:55:00 PM6/25/16
to chromium-hterm, glyn....@gmail.com, davecc...@gmail.com, rbd...@gmail.com
For some reason I was getting "term_ is undefined" no matter what I tried, but when I went to the connection screen and did a ctrl-r I was suddenly able to access term_. Thanks!

yeu...@gmail.com

unread,
Jul 30, 2016, 10:25:34 PM7/30/16
to chromium-hterm, glyn....@gmail.com, davecc...@gmail.com, rbd...@gmail.com, max.lau...@gmail.com
i have the exact same issue. this used to work for me but does not work anymore. super frustrating like you said!

halto...@intel.com

unread,
Aug 3, 2016, 8:23:22 PM8/3/16
to chromium-hterm, glyn....@gmail.com, davecc...@gmail.com, rbd...@gmail.com, max.lau...@gmail.com
Same here, I'm not sure how many times open/close inspector, but finally term_ is there and I am able to remove know hosts.

dcrobe...@gmail.com

unread,
Dec 29, 2016, 9:59:14 PM12/29/16
to chromium-hterm, vps...@gmail.com
Hi - old thread, but if anyone else comes across it and is having problems - if you have set your SSH client to open in a window, you might not be able to open the Javascript console for that window. You need to right click the icon in the application launcher thingie and uncheck the 'Open as window' option. Then it will open in a browser window and give access to the console.

:-)

bobr...@gmail.com

unread,
Oct 26, 2018, 12:39:53 PM10/26/18
to chromium-hterm, vps...@gmail.com
This is an old thread but I just noticed something new (to me)...

Right in the SSH app in Chrome, use Ctrl/Cmd + Right Click your mouse to a context menu. You will see several choices there, including one that will let you clear known hosts.

chrome-ssh-menu.JPG



To be clear - that's CTRL on a Linux or Windows PC and CMD on a Mac.

Thanks!

jon9...@gmail.com

unread,
Nov 2, 2018, 6:30:04 PM11/2/18
to chromium-hterm, vps...@gmail.com
Thank you!!!

omka...@gmail.com

unread,
Jan 25, 2019, 12:12:49 PM1/25/19
to chromium-hterm, vps...@gmail.com
Many Thanks!

green...@gmail.com

unread,
Aug 8, 2019, 2:14:08 PM8/8/19
to chromium-hterm, vps...@gmail.com
Wow, so simple. Thanks. Now I don't have to go into the Javascript interface.

Marc Bernard Schauber

unread,
Feb 24, 2021, 12:26:35 AM2/24/21
to chromium-hterm, green...@gmail.com, vps...@gmail.com
Any update on this?  It no longer works... throwing the following error:
VM244:1 Uncaught ReferenceError: term_ is not defined
    at <anonymous>:1:1

Pobega

unread,
Jun 26, 2021, 8:22:11 PM6/26/21
to chromium-hterm, Marc Bernard Schauber, green...@gmail.com, vps...@gmail.com
@Marc, the known hosts file is now exposed under 'Options -> SSH Files' on the left column.

Marc Bernard Schauber

unread,
Jun 26, 2021, 11:16:31 PM6/26/21
to Pobega, chromium-hterm, green...@gmail.com, vps...@gmail.com
Thank you.  It's nice to see it has been moved to an easy to edit location.
Reply all
Reply to author
Forward
0 new messages