all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peng Bai <baipeng@sina.com>
To: 22329@debbugs.gnu.org
Subject: bug#22329: 24.3; Emacs Tramp feature suggestion: adding sg as a default connection method
Date: Fri, 08 Jan 2016 01:29:59 -0600	[thread overview]
Message-ID: <87d1tcplzc.fsf@bai.com> (raw)


Following up a question on Stack Overflow
(http://stackoverflow.com/questions/34643837/in-emacs-how-do-i-use-tramp-ssh-to-edit-as-a-different-group-id):

I suggest adding "sg" as a default connection method. My specific use
case is that I have an account on a server, and that user belongs to
multiple groups (main group "group_A", secondary group "group_B") for
administrative reasons. SELinux Access Control is used so even if a
directory is owned by me, but if my main group ID is not right, I will
not be able to create files. In an interactive session, I would do
"chgrp group_B" to switch my main group, and a new shell session will be
created. If remotely launching a program, I would do "ssh foo.com 'sg
group_B /path/to/executable'".

Currently I add the following to my initialization script:

(eval-after-load 'tramp
  '(add-to-list
    'tramp-methods
    '("sg"
      (tramp-login-program "sg")
      (tramp-login-args (("-") ("%u")))
      (tramp-remote-shell "/bin/sh")
      (tramp-remote-shell-args ("-c")))))

Thank you!

Best regards,

Peng






             reply	other threads:[~2016-01-08  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  7:29 Peng Bai [this message]
2016-01-15 10:19 ` bug#22329: 24.3; Emacs Tramp feature suggestion: adding sg as a default connection method Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1tcplzc.fsf@bai.com \
    --to=baipeng@sina.com \
    --cc=22329@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.