[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Default user and host (even if only for su/sudo)?
From: |
Rodrigo Bernardo Pimentel |
Subject: |
Default user and host (even if only for su/sudo)? |
Date: |
Thu, 21 Nov 2002 02:34:16 -0200 |
User-agent: |
Mutt/1.4i |
Hi there.
I've been using tramp for a while, it's really helpful. I use it
mostly with "sudo", to edit system files in my always open xemacs (instead
of "sudo vi").
However, having to type "/address@hidden" is getting old faster
and faster :)
I looked at C-h v tramp-methods and tried to add this to my
~/.xemacs/init.el :
(add-to-list 'tramp-methods '("localsudo" (tramp-connection-function
tramp-open-connection-su) (tramp-rsh-program nil) (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh") (tramp-rsh-args nil) (tramp-rcp-args nil)
(tramp-rcp-keep-date-arg nil) (tramp-su-program "sudo") (tramp-su-args ("-u"
"root" "-s" "localhost"))))
It's identical to the "sudo" method in the original alist, except
that it already assumes "root" as user and "localhost" as the host. The
ideia is that this method should have a fixed (or, at least, "default") user
and machine to "connect to".
Obviously, this doesn't help me, because tramp requires me to type
"address@hidden" anyway. But my question is, is there a way (or how
difficult would it be to create one - I'm not a Lisp programmer) to have
default "user" and "machine" settings? With tramp-default-method-alist, it's
possible to determine a default method for specific user and/or machine, but
can I do the opposite?
So I could type, for instance, "/[sudo/]/etc/fstab" and specify that
the default user and host for the sudo method are "root" and
"localhost". Or, maybe even more, if sudo is my default method, I could type
"/[]/etc/fstab" or something like that: no method specified, therefore
default one; no user and machine, therefore default ones for the chosen
method (which incidentally is also the default). Perhaps something like
"/address@hidden/etc/fstab" and "/address@hidden/etc/fstab" to specify only one
of
the parameters and let the other be the default. Saves a lot of keystrokes
:)
In fact, in the sudo and su methods I'm not even allowed a host
other than "localhost", and I still have to type it!
What do you think?
BTW, I'm using the debian unstable version of tramp (2.0.22-2) (BTW,
it still has the outdated documentation, I had to resort to Google to
understand why method "sudm" didn't work anymore).
TIA,
rbp
PS: I've been off the list for a while, se please forgive me if this has
already been discussed (and, while you're at it, please point me to the
results of t he discussion :)
--
______________________________________________________________________
Rodrigo Bernardo Pimentel <address@hidden>
http://www.linuxsp.org.br
GPG: <0x81F85A48> 7E62 9CA2 C95B FC86 B334 203E C011 2E4D 81F8 5A48
If riding in an airplane is flying, then riding in a boat is swimming.
If you want to experience the element, get out of the vehicle.
- Default user and host (even if only for su/sudo)?,
Rodrigo Bernardo Pimentel <=