[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading ~/.ssh2/hostkeys
From: |
Michael Albinus |
Subject: |
Re: reading ~/.ssh2/hostkeys |
Date: |
Tue, 20 Jan 2004 22:53:00 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
Adrian Lanz <address@hidden> writes:
> I don't know why, but my ssh stores the hostkeys in the directory
> mentioned in the subject of the message. Has anybody a function to
> parse such a directory for use in tramp-completion-function-alist? Or
> should/could I change my ssh configuration or ssh call?
Because I use OpenSSH, I was too lazy implementing SSH2 host name
completion ...
You can try this one:
---
(defun my-parse-shostkeys (dirname)
"Return a list of (user host) tuples allowed to access.
User is always nil."
(let ((regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$"))
(files (directory-files dirname))
result)
(while files
(when (string-match regexp (car files))
(push (list nil (match-string 1 (car files))) result))
(setq files (cdr files)))
result))
(tramp-set-completion-function "ssh"
(append tramp-completion-function-alist-ssh
'((my-parse-shostkeys "~/.ssh2/hostkeys"))))
---
Please let me know whether this works for you.
> Thanks, Adrian.
Best regards, Michael.