tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default user and host (even if only for su/sudo)?


From: Rodrigo Bernardo Pimentel
Subject: Re: Default user and host (even if only for su/sudo)?
Date: Thu, 21 Nov 2002 18:55:45 -0200
User-agent: Mutt/1.4i

On Thu, Nov 21 2002 at 05:42:19PM BRST, Kai Gro├čjohann <address@hidden> wrote:
> Rodrigo Bernardo Pimentel <address@hidden> writes:
> 
> > However, having to type "/address@hidden" is getting old faster
> > and faster :)
> 
> Yes, indeed.  Well, the most recent version of Tramp has a variable
> tramp-default-method-alist which allows you to configure some
> things.  By default, root is the default user for the `su' method,
> for example, so /[su/localhost] should be enough.
> 
> Oh, on XEmacs the default value is nil.  Sorry.

        Why is that?

> Then the host name may be empty, so that /[su/address@hidden might work.  But
> don't count on it...

        I did, and it worked! :)

        Actually, I put in my ~/.xemacs/init.el (minus the comments):

; Setting tramp-default-method-alist won't work if tramp isn't already
; loaded
(require 'tramp)

; Default method
(setq tramp-default-method "sudo")

; Set defaults for "sudo" method
(add-to-list 'tramp-default-method-alist '("localhost" "root" "sudo"))

        And then it works just like I suggested! "C-x C-f /[]/etc/fstab RET"
works like a charm :) Default method and, with it, its default user and
host. Hurra!

> And then, you can always do (setenv "X" "/address@hidden") and type
> C-x C-f $X/etc/passwd RET...

        I must say, while this works perfectly, I don't think it's too
elegant. I'd use it, of course, except that the above worked :)

        Anyway, I tested some more and, in comparison with what I originally
suggested, we have (with the above settigns):

/[]/etc/fstab -- works
/[sudo/]/etc/fstab -- works
/[sudo/address@hidden/etc/fstab -- works
/[sudo/localhost]/etc/fstab -- works
/[localhost]/etc/fstab -- works
/address@hidden/etc/fstab -- DOESN'T work, I don't know why

        5 out of 6, looks good for something I tought wasn't implemented yet
;)

        Thanks a lot,



                rbp
-- 
______________________________________________________________________
 Rodrigo Bernardo Pimentel                         <address@hidden>
 http://www.linuxsp.org.br
 GPG: <0x81F85A48>  7E62 9CA2 C95B FC86 B334 203E C011 2E4D 81F8 5A48 

A Quantum Physicist is like a blind man in a dark room,
looking for a black cat that isn't there.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]