I wanted to be able to ssh into my google cloud instances with spacemacs. I found: https://github.com/dustinfreeman/dustinfreeman.emacs.d/blob/master/init.el#L50
which is based off of: https://qiita.com/tanatana/items/218b19808f2428b125fe
I added
(require 'tramp)
(add-to-list 'tramp-methods
'("gcssh"
(tramp-login-program "gcloud compute ssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
("-o" "UserKnownHostsFile=/dev/null")
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22)))
in my .spacemacs
file under the dotspacemacs/user-init
function. However, if I spc f f
and then type /gcssh:
I get the following error in the *debug tramp*
buffer.
backtrace()
tramp-error(nil user-error "Not a Tramp file name: \"%s\"" "/gcssh:")
apply(tramp-error nil user-error "Not a Tramp file name: \"%s\"" "/gcssh:")
tramp-dissect-file-name("/gcssh:")
helm-ff--create-tramp-name("/gcssh:")
helm-ff-update-when-only-one-matched()
run-hooks(helm-after-update-hook)
helm-log-run-hook(helm-after-update-hook)
#[0 "\301\206\006\0\303 \304\001\236\204\031\0\211\203\025\0\305\001\306\"\210\307\310!\210\210\300\203N\0\311\312\300\"\210\313 \203I\0\314\313 !r\315\316\317\320\321\005!\322\"\323$\216\324\001@\325\"\210\326\300\301\"\210*\210\202N\0\326\300\301\"\210\327\211\022\207" [nil nil helm--force-updating-p helm-get-current-source candidates-process helm-display-mode-line force helm-log-run-hook helm-after-update-hook helm-log "Update preselect candidate %s" helm-window internal--before-with-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-with-selected-window] 2 select-window norecord helm-preselect nil] 7]()
helm-update()
helm-check-new-input("/gcssh:")
helm-check-minibuffer-input()
#[0 "\010\206\005\0\011?\205 \0\302 r\303\304\305\306\307\005!\310\"\311$\216\312 \210\313 *\262\001\207" [helm-in-persistent-action helm-suspend-update-flag internal--before-save-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-save-selected-window] 2 helm-check-minibuffer-input helm-print-error-messages] 7]()
apply(#[0 "\010\206\005\0\011?\205 \0\302 r\303\304\305\306\307\005!\310\"\311$\216\312 \210\313 *\262\001\207" [helm-in-persistent-action helm-suspend-update-flag internal--before-save-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-save-selected-window] 2 helm-check-minibuffer-input helm-print-error-messages] 7] nil)
timer-event-handler([t 0 0 10000 repeat #[0 "\010\206\005\0\011?\205 \0\302 r\303\304\305\306\307\005!\310\"\311$\216\312 \210\313 *\262\001\207" [helm-in-persistent-action helm-suspend-update-flag internal--before-save-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-save-selected-window] 2 helm-check-minibuffer-input helm-print-error-messages] 7] nil idle 0])
Additionally, I tried to use org-babel to connect but nothing happens.
Any ideas, would be greatly appreciated. All the online postings made me believe that it was straight forward. So maybe there is something I'm missing as I am new to emacs
,spacemacs
, and tramp
.
.spacemacs
file after you added the configuration fortramp
? Either withSPC f e R
or restarting Emacs?M-x tramp-change-syntax
or type your path like/ssh:gcssh:
. You'll have to ask another question aboutorg-babel
, it isn't clear what you're trying to do./ssh:gcssh:<user>@<instance>:
and it failed withssh: Could not resolve hostname gcssh: nodename nor servname provided or not known^M
. Additionally,M-x tramp-change-syntax
only yielded one optiondefault
. Lastly, for theorg-babel
I just assumed, maybe naively one would resolve the other./ssh:gcssh:<user>@<instance>:
is not a valid Tramp name. You have definedgcssh
as method, so you must use it like/gcssh:<user>@<instance>:
I suppose.SPC f f
and then/gcssh:
results in the*debug tramp*
error I originally posted.