From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Samuel Banya" Newsgroups: gmane.emacs.help Subject: Need Help With Emacs Tramp Mode For 'gcloud compute ssh' Date: Sun, 08 Aug 2021 23:03:06 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35381"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-552-g2afffd2709-fm-20210805.001-g2afffd27 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 09 05:04:01 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCva5-00093R-BJ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 05:04:01 +0200 Original-Received: from localhost ([::1]:56778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCva4-00064Q-7s for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 08 Aug 2021 23:04:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCvZd-00064C-5l for help-gnu-emacs@gnu.org; Sun, 08 Aug 2021 23:03:33 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:41035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCvZb-0004oZ-45 for help-gnu-emacs@gnu.org; Sun, 08 Aug 2021 23:03:32 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 188AB32001BB for ; Sun, 8 Aug 2021 23:03:28 -0400 (EDT) Original-Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Sun, 08 Aug 2021 23:03:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:date:from:to:subject:content-type; s= fm3; bh=FV1pfnlp2MG+DU479T91WUepasz6Es0j53jndoNm73E=; b=ISaqEpsX Lqsh+SH/wzfsDaEgFxjUidsY0tue+uq4ZlmJ24BuDPZovhXAr0clCz9yXjvIdR/3 ylFDlr/QTZC84SJmrx7BuS8bLWmoTz8zEiZgarI8ON6NPVlmxKkkKBHNG8ZVt7WS DzBaKLN8sWAoh23b3EfqDHI8MjE0NxxKnMQS3ND2CVhvbcfApGQWdHqbL9PPIh4t SEcHNH4VJ5ZVdQJ/f+6fs6CI1o/vqKGnS5vcn2QsQCwzZYPNUH/derezmSf2yvIT ZoOlQfckPVDEbW8n2WxqCU4+tOqtz6uIvDWKi6iBwhA8RC+l+ezqdMsMrhYyvPpe aRL9rFEAKTwy4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=FV1pfnlp2MG+DU479T91WUepasz6E s0j53jndoNm73E=; b=v3Y1O2sT9JKVSLrFana+P5Jf5ANaoczAjrxDNP/Uw8ik7 RIIb7iYOurCxsML3yqsk97k9iojIfcSjMdOv2Iy9i5G0Bm4N81VjnVry5Poc6lj0 ixEbdrzuTXds74B0xZSDgiRDJI0SEjI3//IVzV2+lkgIFlIK9JCBO7xnW4a1XdrB Ut1iBOHSPGtTGVL65UsxZsfk+UhkSOanWZUOwL+r4h7iYC0JUwcj0O0UGPpynYcY U8EoYS6Ic2cxBEUMAm/QdHzVE2HydVLwGI6rPGF6LcqVauHJZRVtUNGGMxksX/iG QPxfXvBU95aLjolyUDJEarzd4vFWwGkxzShbmwDfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjeeigdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesrgdtreerre ertdenucfhrhhomhepfdfurghmuhgvlhcuuegrnhihrgdfuceoshgsrghnhigrsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepteevgffggeekteehueekheeuue efheefkeeggfelfeetgfeigeekieduiefffeejnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepshgsrghnhigrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 91ECAFA0AA4; Sun, 8 Aug 2021 23:03:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Received-SPF: pass client-ip=64.147.123.24; envelope-from=sbanya@fastmail.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132427 Archived-At: Hello there, I have looked high and low on the internet, and can't find a decent answer on how to utilize Tramp Mode for 'gcloud compute ssh'. This is the command I need to run for work, since I remote into gcloud (GCP) based jump boxes, so I need to use the '--project' parameter accordingly: gcloud compute ssh --project ops-dist-(client's environment name) (client's environment name)-cli I have the following present in my Emacs config so far, but am completely stuck as all there's to go off is the source code itself, and I really only use Org Mode and Emacs for notes, and super light programming: ** WORK-SPECIFIC Add 'tramp' to easily ssh into gcp jumpbox and ssh into 'aa-master' #+BEGIN_SRC emacs-lisp (use-package tramp :ensure t :config (add-to-list 'tramp-methods '("gcssh" (tramp-login-program "gcloud compute ssh") (tramp-login-args (("%h --project example-project example-project-cli"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/bash") (tramp-remote-shell-args ("-c")) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") ("-o" "UserKnownHostsFile=/dev/null") ("-o" "StrictHostKeyChecking=no"))) (tramp-default-port 22)))) (defun gcp-box-connect () (interactive) (find-file "/gcssh:compute-instance:/path/to/filename.clj")) ;; NOTE: Uncommenting when I figure out the full path to what I need to add and will most likely add it to a 'secrets' file: ;; Suggested format: ;; C-x C-f /gcssh:compute-instance:/path/to/filename.clj (global-set-key (kbd "C-M-g") 'gcp-box-connect) #+END_SRC