all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* run ssh in emacs
@ 2015-01-12 19:32 Haines Brown
  2015-01-12 19:42 ` Tory S. Anderson
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-12 19:32 UTC (permalink / raw)
  To: help-gnu-emacs

I want to gain access to two machines on the LAN by means of ssh. In
order to use emacs as a file manager, I do # ssh -Y remotehost, and then
start emacs on that host, and split its window. One buffer accesses
files on the remote machine, and I want the other buffer to access the 
local machine in order to use emacs to transfer files between the
hosts. However, this does not work.

For example, if I bring up a shell in emacs (C-!) and do ! ssh localhost,
I get:

  Pseudo-terminal will not be allocated because stdin is not a terminal.
  ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
  Permission denied, please try again.
  ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
  Permission denied, please try again.
  ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
  Permission denied (publickey,password).

Is the problem not having access to pseudo-terminal, or it that there is
no /usr/bin/ssh-askpass file? How do I construct that file. Why can't I
just provide the password when prompted for it?

Haines Brown


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-12 19:32 run ssh in emacs Haines Brown
@ 2015-01-12 19:42 ` Tory S. Anderson
  2015-01-13 12:38   ` Haines Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Tory S. Anderson @ 2015-01-12 19:42 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

I do something similar (I think) with my web development, but I go about it differently. I am already in emacs on my local machine and use the `M-x shell` to then ssh into the remote machine. For file management, I Tramp set up to use SSH by default, and I've had success copying back and forth remote-to-local and vice versa that way. Using dired/tramp, I can just highlight a file and hit "C" (copy) and enter the local location, or the other way around. It works pretty well for me (I've replaced putty and Filezilla with emacs), and I was doing a split-screen local/remote just yesterday with it. 

- Tory

Haines Brown <haines@histomat.net> writes:

> I want to gain access to two machines on the LAN by means of ssh. In
> order to use emacs as a file manager, I do # ssh -Y remotehost, and then
> start emacs on that host, and split its window. One buffer accesses
> files on the remote machine, and I want the other buffer to access the 
> local machine in order to use emacs to transfer files between the
> hosts. However, this does not work.
>
> For example, if I bring up a shell in emacs (C-!) and do ! ssh localhost,
> I get:
>
>   Pseudo-terminal will not be allocated because stdin is not a terminal.
>   ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
>   Permission denied, please try again.
>   ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
>   Permission denied, please try again.
>   ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
>   Permission denied (publickey,password).
>
> Is the problem not having access to pseudo-terminal, or it that there is
> no /usr/bin/ssh-askpass file? How do I construct that file. Why can't I
> just provide the password when prompted for it?
>
> Haines Brown



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-12 19:42 ` Tory S. Anderson
@ 2015-01-13 12:38   ` Haines Brown
  2015-01-13 13:04     ` Nikolay Kudryavtsev
                       ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Haines Brown @ 2015-01-13 12:38 UTC (permalink / raw)
  To: Tory S. Anderson; +Cc: help-gnu-emacs

On Mon, Jan 12, 2015 at 02:42:23PM -0500, Tory S. Anderson wrote:

> I do something similar (I think) with my web development, but I go
>  about it differently. I am already in emacs on my local machine and
>  use the `M-x shell` to then ssh into the remote machine. For file
>  management, I Tramp set up to use SSH by default, and I've had
>  success copying back and forth remote-to-local and vice versa that
>  way. Using dired/tramp, I can just highlight a file and hit "C"
>  (copy) and enter the local location, or the other way around. It
>  works pretty well for me (I've replaced putty and Filezilla with
>  emacs), and I was doing a split-screen local/remote just yesterday
>  with it.
> 
> - Tory

Thanks, Tory, that was a help. I was trying to run ssh from command
prompt rather than shell. 

Can I expand on my question with one that is a bit OT? I use ~/.netrc
(despite the hazards) to automate log in to remote machines. However
things seem to have changed over the years since I last used it. I have
a stanza like this, where anon will be the name of remote machine on the
LAN

   machine root@anon
        login root
        password <password>

When in Emacs I log into the remote machine with 

   C-x C-f /root@anon:/home/user

I am prompted for the password which is not automatically sent:

   Password for /scpc:root@anon

This "scpc" method is new to me. I tried putting into .netrc the machine
value scpc.root@anon and scpc:root@anon, but still am prompted for the
password. The Tramp manual and man netrc no help.

Haines
    


 



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 12:38   ` Haines Brown
@ 2015-01-13 13:04     ` Nikolay Kudryavtsev
  2015-01-13 13:18       ` Tory S. Anderson
  2015-01-13 13:21       ` Michael Albinus
  2015-01-13 13:18     ` Tory S. Anderson
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 32+ messages in thread
From: Nikolay Kudryavtsev @ 2015-01-13 13:04 UTC (permalink / raw)
  To: help-gnu-emacs

Tramp methods are defined in tramp. See C-h v tramp-methods. And did you 
mean scp?

To save password in tramp you can put your login and password into a 
file called ~/.authinfo.gpg in this format:
machine anon login root password my-password

Authinfo is protected by gpg, so you gonna get asked for a password for 
it, but just once.

Alternatively you can use authorization by key.

-- 
Best Regards,
Nikolay Kudryavtsev




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 12:38   ` Haines Brown
  2015-01-13 13:04     ` Nikolay Kudryavtsev
@ 2015-01-13 13:18     ` Tory S. Anderson
  2015-01-13 13:28       ` Michael Albinus
  2015-01-13 14:29     ` Tory S. Anderson
       [not found]     ` <mailman.17800.1421154285.1147.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 32+ messages in thread
From: Tory S. Anderson @ 2015-01-13 13:18 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

Yeah,  it uses SCPC by default, and I found it pretty annoying. It was fixed by adding the following to my .emacs: 

    ;; Tramp
    (require 'tramp)
    (setq tramp-default-method "ssh")


Haines Brown <haines@histomat.net> writes:

> On Mon, Jan 12, 2015 at 02:42:23PM -0500, Tory S. Anderson wrote:
>
>> I do something similar (I think) with my web development, but I go
>>  about it differently. I am already in emacs on my local machine and
>>  use the `M-x shell` to then ssh into the remote machine. For file
>>  management, I Tramp set up to use SSH by default, and I've had
>>  success copying back and forth remote-to-local and vice versa that
>>  way. Using dired/tramp, I can just highlight a file and hit "C"
>>  (copy) and enter the local location, or the other way around. It
>>  works pretty well for me (I've replaced putty and Filezilla with
>>  emacs), and I was doing a split-screen local/remote just yesterday
>>  with it.
>> 
>> - Tory
>
> Thanks, Tory, that was a help. I was trying to run ssh from command
> prompt rather than shell. 
>
> Can I expand on my question with one that is a bit OT? I use ~/.netrc
> (despite the hazards) to automate log in to remote machines. However
> things seem to have changed over the years since I last used it. I have
> a stanza like this, where anon will be the name of remote machine on the
> LAN
>
>    machine root@anon
>         login root
>         password <password>
>
> When in Emacs I log into the remote machine with 
>
>    C-x C-f /root@anon:/home/user
>
> I am prompted for the password which is not automatically sent:
>
>    Password for /scpc:root@anon
>
> This "scpc" method is new to me. I tried putting into .netrc the machine
> value scpc.root@anon and scpc:root@anon, but still am prompted for the
> password. The Tramp manual and man netrc no help.
>
> Haines
>     
>
>
>  



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 13:04     ` Nikolay Kudryavtsev
@ 2015-01-13 13:18       ` Tory S. Anderson
  2015-01-13 13:21       ` Michael Albinus
  1 sibling, 0 replies; 32+ messages in thread
From: Tory S. Anderson @ 2015-01-13 13:18 UTC (permalink / raw)
  To: Nikolay Kudryavtsev; +Cc: help-gnu-emacs

whoa. Where has that been all my life? I think .authinfo.gpg is going to save me much time. 

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> Tramp methods are defined in tramp. See C-h v tramp-methods. And did you mean scp?
>
> To save password in tramp you can put your login and password into a file called ~/.authinfo.gpg in this format:
> machine anon login root password my-password
>
> Authinfo is protected by gpg, so you gonna get asked for a password for it, but just once.
>
> Alternatively you can use authorization by key.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 13:04     ` Nikolay Kudryavtsev
  2015-01-13 13:18       ` Tory S. Anderson
@ 2015-01-13 13:21       ` Michael Albinus
  1 sibling, 0 replies; 32+ messages in thread
From: Michael Albinus @ 2015-01-13 13:21 UTC (permalink / raw)
  To: Nikolay Kudryavtsev; +Cc: help-gnu-emacs

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> Tramp methods are defined in tramp. See C-h v tramp-methods. And did
> you mean scp?

"scpc" was a supported Tramp method up to Tramp 2.2.6. It has been
removed then.

> To save password in tramp you can put your login and password into a
> file called ~/.authinfo.gpg in this format:
> machine anon login root password my-password
>
> Authinfo is protected by gpg, so you gonna get asked for a password
> for it, but just once.
>
> Alternatively you can use authorization by key.

It might also be helpful to read the Tramp manual for this topic:

(info "(tramp)Password handling")

Best regards, Michael.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 13:18     ` Tory S. Anderson
@ 2015-01-13 13:28       ` Michael Albinus
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Albinus @ 2015-01-13 13:28 UTC (permalink / raw)
  To: Tory S. Anderson; +Cc: help-gnu-emacs, Haines Brown

torys.anderson@gmail.com (Tory S. Anderson) writes:

> Yeah, it uses SCPC by default, and I found it pretty annoying. It was
> fixed by adding the following to my .emacs:
>
>     ;; Tramp
>     (require 'tramp)
>     (setq tramp-default-method "ssh")

Well, meanwhile it is "scp". This is pretty much the same behaviour like
"ssh", except for files longer than ~10kB. And for those large files,
"scp" ought to copy faster.

Admittedly, it needs a proper password handling ...

Best regards, Michael.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 12:38   ` Haines Brown
  2015-01-13 13:04     ` Nikolay Kudryavtsev
  2015-01-13 13:18     ` Tory S. Anderson
@ 2015-01-13 14:29     ` Tory S. Anderson
  2015-01-13 15:16       ` Haines Brown
       [not found]       ` <mailman.17814.1421162216.1147.help-gnu-emacs@gnu.org>
       [not found]     ` <mailman.17800.1421154285.1147.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 32+ messages in thread
From: Tory S. Anderson @ 2015-01-13 14:29 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

I forgot to mention, I also found this handy (although I might be able to forego it with the authinfo trick):

    ;Cache passwords for one hour
    (setq password-cache-expiry 3600)

With this you don't have to enter your password every few minutes...

Haines Brown <haines@histomat.net> writes:

> On Mon, Jan 12, 2015 at 02:42:23PM -0500, Tory S. Anderson wrote:
>
>> I do something similar (I think) with my web development, but I go
>>  about it differently. I am already in emacs on my local machine and
>>  use the `M-x shell` to then ssh into the remote machine. For file
>>  management, I Tramp set up to use SSH by default, and I've had
>>  success copying back and forth remote-to-local and vice versa that
>>  way. Using dired/tramp, I can just highlight a file and hit "C"
>>  (copy) and enter the local location, or the other way around. It
>>  works pretty well for me (I've replaced putty and Filezilla with
>>  emacs), and I was doing a split-screen local/remote just yesterday
>>  with it.
>> 
>> - Tory
>
> Thanks, Tory, that was a help. I was trying to run ssh from command
> prompt rather than shell. 
>
> Can I expand on my question with one that is a bit OT? I use ~/.netrc
> (despite the hazards) to automate log in to remote machines. However
> things seem to have changed over the years since I last used it. I have
> a stanza like this, where anon will be the name of remote machine on the
> LAN
>
>    machine root@anon
>         login root
>         password <password>
>
> When in Emacs I log into the remote machine with 
>
>    C-x C-f /root@anon:/home/user
>
> I am prompted for the password which is not automatically sent:
>
>    Password for /scpc:root@anon
>
> This "scpc" method is new to me. I tried putting into .netrc the machine
> value scpc.root@anon and scpc:root@anon, but still am prompted for the
> password. The Tramp manual and man netrc no help.
>
> Haines
>     
>
>
>  



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 14:29     ` Tory S. Anderson
@ 2015-01-13 15:16       ` Haines Brown
  2015-01-13 15:23         ` Tory S. Anderson
       [not found]         ` <mailman.17817.1421162618.1147.help-gnu-emacs@gnu.org>
       [not found]       ` <mailman.17814.1421162216.1147.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 32+ messages in thread
From: Haines Brown @ 2015-01-13 15:16 UTC (permalink / raw)
  To: Tory S. Anderson; +Cc: help-gnu-emacs

On Tue, Jan 13, 2015 at 09:29:59AM -0500, Tory S. Anderson wrote:

> I forgot to mention, I also found this handy (although I might be able
> to forego it with the authinfo trick):
> 
>     ;Cache passwords for one hour
>     (setq password-cache-expiry 3600)

I've made some progress, but still can't access the password in the
~/.netrc file. More specifically, in emacs I do

	C-x C-f
	/user@anon:

and get:
    
    Password for /ssh:user@anon:

even though in ~/.netrc I have the stanza:

    machine user@anon
        login user 
        password <password>

It seems the ~.netrc file not being read.

Haines




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 15:16       ` Haines Brown
@ 2015-01-13 15:23         ` Tory S. Anderson
  2015-01-13 18:11           ` Haines Brown
       [not found]         ` <mailman.17817.1421162618.1147.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 32+ messages in thread
From: Tory S. Anderson @ 2015-01-13 15:23 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

As I recall, Tramp (which you are using with C-x C-f) by default uses .authinfo or .authinfo.gpg, not .netrc. I've started using these and have been impressed (as of 2 hours in)

Haines Brown <haines@histomat.net> writes:

> On Tue, Jan 13, 2015 at 09:29:59AM -0500, Tory S. Anderson wrote:
>
>> I forgot to mention, I also found this handy (although I might be able
>> to forego it with the authinfo trick):
>> 
>>     ;Cache passwords for one hour
>>     (setq password-cache-expiry 3600)
>
> I've made some progress, but still can't access the password in the
> ~/.netrc file. More specifically, in emacs I do
>
> 	C-x C-f
> 	/user@anon:
>
> and get:
>     
>     Password for /ssh:user@anon:
>
> even though in ~/.netrc I have the stanza:
>
>     machine user@anon
>         login user 
>         password <password>
>
> It seems the ~.netrc file not being read.
>
> Haines



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]       ` <mailman.17814.1421162216.1147.help-gnu-emacs@gnu.org>
@ 2015-01-13 16:59         ` Dan Espen
  0 siblings, 0 replies; 32+ messages in thread
From: Dan Espen @ 2015-01-13 16:59 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> On Tue, Jan 13, 2015 at 09:29:59AM -0500, Tory S. Anderson wrote:
>
>> I forgot to mention, I also found this handy (although I might be able
>> to forego it with the authinfo trick):
>> 
>>     ;Cache passwords for one hour
>>     (setq password-cache-expiry 3600)
>
> I've made some progress, but still can't access the password in the
> ~/.netrc file. More specifically, in emacs I do
>
> 	C-x C-f
> 	/user@anon:
>
> and get:
>     
>     Password for /ssh:user@anon:
>
> even though in ~/.netrc I have the stanza:
>
>     machine user@anon

machine anon

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 15:23         ` Tory S. Anderson
@ 2015-01-13 18:11           ` Haines Brown
  2015-01-14  4:26             ` Bob Proulx
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-13 18:11 UTC (permalink / raw)
  To: Tory S. Anderson; +Cc: help-gnu-emacs

On Tue, Jan 13, 2015 at 10:23:14AM -0500, Tory S. Anderson wrote: 

> As I recall, Tramp (which you are using with C-x C-f) by default uses
> .authinfo or .authinfo.gpg, not .netrc. I've started using these and
> have been impressed (as of 2 hours in)

That was my problem. Years ago I used ftp to transfer files, and so
used ~/.netrc. I followed your suggestion and instead use ~/.authinfo,
and how I have no problem accessing hosts on my LAN. 

When I try to access web servers via ssh, however, it does not work. 
For example, in .authinfo I have this:

    machine uss-irex.info:/www
        login <user>
        password <password>

So I do C-x C-f /uss-irex.info:/www and I'm prompted for the password.
The password not accepted. If I do C-x C-f /user@uss-irex.info:
apparently the user is recognied because when I enter the password at 
prompt, but I'm told I lack permission.

Haines



> 
> Haines Brown <haines@histomat.net> writes:
> 
> > On Tue, Jan 13, 2015 at 09:29:59AM -0500, Tory S. Anderson wrote:
> >
> >> I forgot to mention, I also found this handy (although I might be able
> >> to forego it with the authinfo trick):
> >> 
> >>     ;Cache passwords for one hour
> >>     (setq password-cache-expiry 3600)
> >
> > I've made some progress, but still can't access the password in the
> > ~/.netrc file. More specifically, in emacs I do
> >
> > 	C-x C-f
> > 	/user@anon:
> >
> > and get:
> >     
> >     Password for /ssh:user@anon:
> >
> > even though in ~/.netrc I have the stanza:
> >
> >     machine user@anon
> >         login user 
> >         password <password>
> >
> > It seems the ~.netrc file not being read.
> >
> > Haines



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-13 18:11           ` Haines Brown
@ 2015-01-14  4:26             ` Bob Proulx
  0 siblings, 0 replies; 32+ messages in thread
From: Bob Proulx @ 2015-01-14  4:26 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

Haines Brown wrote:
> That was my problem. Years ago I used ftp to transfer files, and so
> used ~/.netrc. I followed your suggestion and instead use ~/.authinfo,
> and how I have no problem accessing hosts on my LAN. 

I recommend using ssh rsa keys.  Works great generically with ssh and
isn't tramp specific.  The tramp manual also recommends using the
native transport mechanisms.

> When I try to access web servers via ssh, however, it does not work. 
> For example, in .authinfo I have this:
> 
>     machine uss-irex.info:/www
>         login <user>
>         password <password>

That "uss-irex.info:/www" looks like a syntax error to me.  Remove the
":/www" from it and try it again.

Bob



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]     ` <mailman.17800.1421154285.1147.help-gnu-emacs@gnu.org>
@ 2015-01-14 12:14       ` Haines Brown
  2015-01-14 19:55         ` Bob Proulx
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-14 12:14 UTC (permalink / raw)
  To: help-gnu-emacs

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> Tramp methods are defined in tramp. See C-h v tramp-methods. And did
> you mean scp?
>
> To save password in tramp you can put your login and password into a
> file called ~/.authinfo.gpg in this format: machine anon login root
> password my-password

Nikolay, your advice much appreciated, and I did make progress. I set
the method to ssh in tramp initiation file. I now use ~/.authinfo and
can readily log in to the remote LAN machine. However, this automated
transmission of the password works only for users, not if the user is
"root".

For example, if in ~/.authinfo I have the stanza:

    machine target
      login root
      password Geheim

When in emacs I do C-x C-f /root@target: or /target:, I'm prompted for
the password. The password was transmitted for user accounts but not for
the root account.

I need to ssh as root because my aim is to use emacs dired to copy files
belonging to root between the target and the local machines. I can su to
root and then start emacs, but this session for some reason does not use
the tramp init file.

The manual says I can use (set auth-source-debug `t). I put this line in my
tramp init file, but where is its output?

I here toss in an observation that is irrevant. If the method is news, I
find that the stanza in .authinfo must be inline, such as:

    machine news.giganews.com login Benutzer password Geheim

  If I arrange this in a column as in the "target" example above, it
  does not work.

Haines






>
> Authinfo is protected by gpg, so you gonna get asked for a password for it,
> but just once.
>
> Alternatively you can use authorization by key.


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-14 12:14       ` Haines Brown
@ 2015-01-14 19:55         ` Bob Proulx
  0 siblings, 0 replies; 32+ messages in thread
From: Bob Proulx @ 2015-01-14 19:55 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown wrote:
> For example, if in ~/.authinfo I have the stanza:

I am curious.  Is there a reason you are avoiding using rsa ssh keys?
If you were using ssh rsa keys then everything you want would be
working natively.  And even better it would work for everything that
uses ssh too such as rsync and other processes that use ssh.

Bob



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]         ` <mailman.17817.1421162618.1147.help-gnu-emacs@gnu.org>
@ 2015-01-15 16:26           ` Haines Brown
  2015-01-15 17:19             ` Ted Zlatanov
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-15 16:26 UTC (permalink / raw)
  To: help-gnu-emacs

I've taken almost six hours from pressing work to get tramp to access
web servers, and have gotten nowhere.

The tramp manual says that default authorization file is
~/.authinfo.gpg. I assume I can use ~/.authinfo until I get things
working.

When I use tramp in emcas (C-x C-f), I get a quick alert: .netrc is
either not owned by you or badly protected. The latter is the case. I
have an old .netrc file with commented lines in it.

I have impression the default tramp method is ftp, but if my C-x C-f
command does not specify the method, the ssh method is instead used
because in the tramp init file I specifid ftp as tramp's default
method. I must access web servers with FTP, but I make ssh the defalt
method because that's what I use to access hosts on my LAN. So when I
access web servers I need to specify the ftp protocol.

Man authinfo and info tramp do not tell me how to specify the method in
the C-x C-f command, but I find by trial and error that I can manually
log successfully with:

    C-x C-f /ftp:user@server.com:

However, to log in automatically, I must define method and user in the
.authinfo file. I can specify user and pw for my LAN hosts, but
apparently it does not work for web servers. Thus the need to specify
method and user in the command line.

The tramp manual says my .authinfo line should look like this:

    machine server.com login Benutzer password Geheim

But this does not work, for the password is nevertheless requested.

If I insist by repeating the login, I can get this:

   ftp> user "Benutzer"
   331 Password required for user Benutzer
   530 Login incorrect
   ftp>

I rechecked with the web server, and its protocol is FTP, and my account
name and PW are correct. That I'm unable to log in automatically
therefore suggests a synax error that prevents the info in .authinfo
from being used. 

Haines 



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-15 16:26           ` Haines Brown
@ 2015-01-15 17:19             ` Ted Zlatanov
  2015-01-15 20:26               ` Haines Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Ted Zlatanov @ 2015-01-15 17:19 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 15 Jan 2015 11:26:53 -0500 Haines Brown <haines@histomat.net> wrote: 

HB> The tramp manual says that default authorization file is
HB> ~/.authinfo.gpg. I assume I can use ~/.authinfo until I get things
HB> working.

What does `auth-sources' contain?

Turn `auth-source-debug' to 'trivia to see useful debug logs in
*Messages*.  That will help you figure out what's going wrong, and what
specifically is needed in the .authinfo file.

Ted


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-15 17:19             ` Ted Zlatanov
@ 2015-01-15 20:26               ` Haines Brown
  2015-01-15 21:10                 ` Ted Zlatanov
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-15 20:26 UTC (permalink / raw)
  To: help-gnu-emacs

Ted Zlatanov <tzz@lifelogs.com> writes:

> What does `auth-sources' contain?
>
> Turn `auth-source-debug' to 'trivia to see useful debug logs in
> *Messages*.  That will help you figure out what's going wrong, and what
> specifically is needed in the .authinfo file.

Thanks, Ted, but I've made no progress. Auth-sources is new to me. I've
managed for years without being aware of it. I suppose that's because
its defaults suited my needs. Now I'm variouly told it is both a library
and a variable, which leaves me uncomfortable.

I should start by describing my setup. I have several emacs init files
depending on what I intend to do with an emacs session. In .fluxbox
there is a key binding that starts an executable script named
~/scripts/emacs-util. This file runs emacs with a specific init file
that I named ~.emacsUtility. This init file has a variety of things in
it, but includes these lines:

    (add-to-list 'load-path "/home/haines/.emacs.d/elisp/")
        (load-library "tramp")

This ~/.emacs.d/elisp/tramp is an init file that has only these lines:

     (set auth-source-debug `trivia)
     (setq tramp-default-method "ssh")
     (require 'auth-source) 
     (customize-variable 'auth-sources) 

The second line is because I use SSH most often with LAN hosts. The
third and fourth lines probably unecessary.

This nesting of init files worries me, but I didn't have a problem until
recently. 

I now do C-x C-f /HostName.com:

  ssh: Could not resolve hostname HostName.com. Name or server not known
  Tramp: Waiting for prompts...

  In *Messages* buffer:

    Loading tramp... done
    Tramp: Opening Connection for HostName.com using ssh
    Tramp: Sending command `exec ssh -e None HostName.com

Beucase the web server wants the ftp protocol, my .authinfo file has the
line: 
 
  machine HostName.com port ftp login Benutzer password Geheim

apparently this value for port is not seen. It seems the authinfo file
not being accessed at all, although it is accessed when I SSH to LAN
hosts.

Haines


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-15 20:26               ` Haines Brown
@ 2015-01-15 21:10                 ` Ted Zlatanov
  2015-01-16 17:18                   ` Haines Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Ted Zlatanov @ 2015-01-15 21:10 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 15 Jan 2015 15:26:54 -0500 Haines Brown <haines@histomat.net> wrote: 

HB> Ted Zlatanov <tzz@lifelogs.com> writes:
>> What does `auth-sources' contain?
>> 
>> Turn `auth-source-debug' to 'trivia to see useful debug logs in
>> *Messages*.  That will help you figure out what's going wrong, and what
>> specifically is needed in the .authinfo file.

HB> Thanks, Ted, but I've made no progress. Auth-sources is new to me. I've
HB> managed for years without being aware of it. I suppose that's because
HB> its defaults suited my needs. Now I'm variouly told it is both a library
HB> and a variable, which leaves me uncomfortable.

`auth-sources' is a variable (the `quoted' format is standard in the
Emacs community).  So is `auth-source-debug'.  auth-source.el is a library.

You may want to consult (info "auth") to learn more about the library.

HB> This ~/.emacs.d/elisp/tramp is an init file that has only these lines:

HB>      (set auth-source-debug `trivia)
HB>      (setq tramp-default-method "ssh")
HB>      (require 'auth-source) 
HB>      (customize-variable 'auth-sources) 

HB> The second line is because I use SSH most often with LAN hosts. The
HB> third and fourth lines probably unecessary.

Yes, the third is superfluous and the fourth is probably wrong.

More importantly, (set auth-source-debug `trivia) is just wrong.  You
mean to use `setq' there, but you should just customize the variable:

`M-x customize-variable RET auth-source-debug'

Save the customization.  Done.  Learn this method and use it for all
variables you want to change.  The interface is very helpful.

Do the same for `tramp-default-method' to set it to "ssh" as you desire.
There's no reason to run these only when you use Tramp.

HB> I now do C-x C-f /HostName.com:

HB>   ssh: Could not resolve hostname HostName.com. Name or server not known
HB>   Tramp: Waiting for prompts...

HB>   In *Messages* buffer:

HB>     Loading tramp... done
HB>     Tramp: Opening Connection for HostName.com using ssh
HB>     Tramp: Sending command `exec ssh -e None HostName.com

Erm, you're using SSH in your example but we started with FTP...

With SSH, this will have nothing to do with auth-source. SSH has its own
authentication system, typically managed through ssh-agent and so on.

HB> Beucase the web server wants the ftp protocol, my .authinfo file has the
HB> line:
 
HB>   machine HostName.com port ftp login Benutzer password Geheim

HB> apparently this value for port is not seen. It seems the authinfo file
HB> not being accessed at all, although it is accessed when I SSH to LAN
HB> hosts.

Set `auth-source-debug' to 'trivia as requested, then open
`/ftp:username@hostname.com' and see what shows up in the *Messages*
buffer (to see it, type `C-x b *Messages*').

Ted


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-15 21:10                 ` Ted Zlatanov
@ 2015-01-16 17:18                   ` Haines Brown
  2015-01-16 19:59                     ` Michael Albinus
       [not found]                     ` <mailman.18043.1421438398.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 32+ messages in thread
From: Haines Brown @ 2015-01-16 17:18 UTC (permalink / raw)
  To: help-gnu-emacs

Ted Zlatanov <tzz@lifelogs.com> writes:

> More importantly, (set auth-source-debug `trivia) is just wrong.  You
> mean to use `setq' there, but you should just customize the variable:
>
> `M-x customize-variable RET auth-source-debug'
>
> Save the customization.  Done.  Learn this method and use it for all
> variables you want to change.  The interface is very helpful.
>
> Do the same for `tramp-default-method' to set it to "ssh" as you desire.
> There's no reason to run these only when you use Tramp.

To keep things simple, I customized the auth-source variable to debug
and also the tramp-default-method to ftp. Even though I will want to
make ssh default, my concern at this point is to get access to web
server. I saved the customization. 

> HB> I now do C-x C-f /HostName.com:

> Erm, you're using SSH in your example but we started with FTP...
>
> With SSH, this will have nothing to do with auth-source. SSH has its own
> authentication system, typically managed through ssh-agent and so on.

With SSH to local hosts, I am presently successfully using
.authinfo. The reason for ssh showing up in the output is that I was
uncertain how to set the method for tramp to use, and to took most
conservative choice for the trial run. 

In my ~/authinfo I have the line:

  machine Host.com port ftp login Benutzer password Geheim

> Set `auth-source-debug' to 'trivia as requested, then open
> `/ftp:username@hostname.com' and see what shows up in the *Messages*
> buffer (to see it, type `C-x b *Messages*').

Here is the answer to my question, which the info or man documents did
not answer. This defines the FTP method for the tramp sesson, and I
assume this overrides any tramp default method I may have set.

Running the address returns the request for password, and so .authinfo
apparently not used. The only thing in the *Messages* buffer is the
report that I've created customization setup. Only when I do RET in lieu
of providing a password, do I get a message. 

  1. Custom settings cannot be saved. Maybe you started Emacs with
     -q. 

     This indeed is what I'm doing. However, in my tramp init file
     I have the line (setq auth-source-debug `trivia).

  2. Tramp Default Method: ftp. State: EDITED, shown value does not take
     effect until you set or save it. 

Nothing here about the tramp session. 

I put (setq tramp-default-method "ftp") into my tramp init file and run
again. After the third RET in liew of password, I get a dump:

  (ftp-error #("FTP Error: USER request failed: 530 Login incorrect."
  32 52 (fontified nil front-sticky (field
  inhibit-line-move-field-capture) rear-nonsticky t field output
  inhibit-line-move-field-capture t))) signal(ftp-error (#("FTP Error:
  USER request failed: 530 Login incorrect."  32 52 (fontified nil
  front-sticky (field inhibit-line-move-field-capture) rear-nonsticky t
  field output inhibit-line-move-field-capture t))))
  byte-code("\301\b@\bA\"\207" [err signal] 3)
  ange-ftp-hook-function(expand-file-name "/ftp:ussir03@uss-irex.info:"
  "~/") apply(ange-ftp-hook-function expand-file-name
  ("/ftp:ussir03@uss-irex.info:" "~/"))
  tramp-ftp-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" "~/") apply(tramp-ftp-file-name-handler
  expand-file-name ("/ftp:ussir03@uss-irex.info:" "~/"))
  byte-code("\300\301\215\207" [suppress (apply foreign operation args)]
  2) #[nil "\bK\306\211 <now comes a bunch of hex> *\207" [foreign
  result sf file-name-handler-alist d default-directory nil autoload
  boundp temporary-file-directory eval standard-value fboundp
  temp-directory subrp functionp getenv "TEMP" file-directory-p
  file-name-as-directory "TMP" "TMPDIR" file-exists-p "c:/temp" message
  "Neither `temporary-file-directory' nor `temp-directory' is defined --
  using /tmp." "/tmp" load noerror nomessage non-essential (byte-code
  "\300\301\215\207" [suppress (apply foreign operation args)] 2) 5
  "Non-essential received in operation %s" append (byte-code "\b < a
  bunch of hex >\"\fP$*\207" [level tramp-verbose
  save-match-data-internal tramp-message-show-message fmt-string args
  match-data ((byte-code "\301\b\302\"\207" [save-match-data-internal
  set-match-data evaporate] 3)) 3 apply message 0 "" 1 2 "Warning: "
  "Tramp: " 4 processp buffer-name process-buffer
  tramp-dissect-file-name vectorp tramp-debug-message format "(%d) # "
  vec-or-proc default-directory] 6) ((error)) tramp-run-real-handler
  suppress 1 "Suppress received in operation %s" tramp-cleanup x v
  operation args fmt-string level vec-or-proc
  tramp-message-show-message] 7]()
  tramp-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" "~/")
  expand-file-name("/ftp:ussir03@uss-irex.info:" "~/")
  apply(expand-file-name ("/ftp:ussir03@uss-irex.info:" "~/"))
  tramp-completion-run-real-handler(expand-file-name
  ("/ftp:ussir03@uss-irex.info:" "~/"))
  tramp-completion-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" "~/")
  file-directory-p("/ftp:ussir03@uss-irex.info:")
  apply(file-directory-p "/ftp:ussir03@uss-irex.info:")
  tramp-completion-run-real-handler(file-directory-p
  ("/ftp:ussir03@uss-irex.info:"))
  tramp-completion-file-name-handler(file-directory-p
  "/ftp:ussir03@uss-irex.info:")
  file-directory-p("/ftp:ussir03@uss-irex.info:")
  find-file-noselect("/ftp:ussir03@uss-irex.info:" nil nil t)
  find-file("/ftp:ussir03@uss-irex.info:" t)
  call-interactively(find-file nil nil)
  read-string("Password for ussir03@uss-irex.info: " nil t nil)
  read-passwd("Password for ussir03@uss-irex.info: ")
  ange-ftp-get-passwd("uss-irex.info" "ussir03")
  ange-ftp-get-process("uss-irex.info" "ussir03")
  ange-ftp-host-type("uss-irex.info" "ussir03")
  ange-ftp-expand-dir("uss-irex.info" "ussir03" "~")
  ange-ftp-canonize-filename("/ftp:ussir03@uss-irex.info:")
  ange-ftp-expand-file-name("/ftp:ussir03@uss-irex.info:" nil)
  apply(ange-ftp-expand-file-name ("/ftp:ussir03@uss-irex.info:" nil))
  byte-code("\304\305 \306\216\307\n\v\"+\207" [debug-on-error
  save-match-data-internal fn args t match-data ((byte-code
  "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate]
  3)) apply] 3) ange-ftp-hook-function(expand-file-name
  "/ftp:ussir03@uss-irex.info:" nil) apply(ange-ftp-hook-function
  expand-file-name ("/ftp:ussir03@uss-irex.info:" nil))
  tramp-ftp-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" nil) apply(tramp-ftp-file-name-handler
  expand-file-name ("/ftp:ussir03@uss-irex.info:" nil))
  byte-code("\300\301\215\207" [suppress (apply foreign operation args)]
  2) #[nil "\bK\306...\202\x01 *\207" [foreign result sf
  file-name-handler-alist d default-directory nil autoload boundp
  temporary-file-directory eval standard-value fboundp temp-directory
  subrp functionp getenv "TEMP" file-directory-p file-name-as-directory
  "TMP" "TMPDIR" file-exists-p "c:/temp" message "Neither
  `temporary-file-directory' nor `temp-directory' is defined -- using
  /tmp." "/tmp" load noerror nomessage non-essential (byte-code
  "\300\... $*\207" [level tramp-verbose save-match-data-internal
  tramp-message-show-message fmt-string args match-data ((byte-code
  "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate]
  3)) 3 apply message 0 "" 1 2 "Warning: " "Tramp: " 4 processp
  buffer-name process-buffer tramp-dissect-file-name vectorp
  tramp-debug-message format "(%d) # " vec-or-proc default-directory] 6)
  ((error)) tramp-run-real-handler suppress 1 "Suppress received in
  operation %s" tramp-cleanup x v operation args fmt-string level
  vec-or-proc tramp-message-show-message] 7]() funcall(#[nil
  "\bK\306...\202\x01 ... *\207" [foreign result sf
  file-name-handler-alist d default-directory nil autoload boundp
  temporary-file-directory eval standard-value fboundp temp-directory
  subrp functionp getenv "TEMP" file-directory-p file-name-as-directory
  "TMP" "TMPDIR" file-exists-p "c:/temp" message "Neither
  `temporary-file-directory' nor `temp-directory' is defined -- using
  /tmp." "/tmp" load noerror nomessage non-essential (byte-code
  "\300\301\215\207" [suppress (apply foreign operation args)] 2) 5
  "Non-essential received in operation %s" append (byte-code "\b
  X\205}... *\207" [level tramp-verbose save-match-data-internal
  tramp-message-show-message fmt-string args match-data ((byte-code
  "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate]
  3)) 3 apply message 0 "" 1 2 "Warning: " "Tramp: " 4 processp
  buffer-name process-buffer tramp-dissect-file-name vectorp
  tramp-debug-message format "(%d) # " vec-or-proc default-directory] 6)
  ((error)) tramp-run-real-handler suppress 1 "Suppress received in
  operation %s" tramp-cleanup x v operation args fmt-string level
  vec-or-proc tramp-message-show-message] 7])
  tramp-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" nil)
  expand-file-name("/ftp:ussir03@uss-irex.info:" nil)
  apply(expand-file-name ("/ftp:ussir03@uss-irex.info:" nil))
  tramp-completion-run-real-handler(expand-file-name
  ("/ftp:ussir03@uss-irex.info:" nil))
  tramp-completion-file-name-handler(expand-file-name
  "/ftp:ussir03@uss-irex.info:" nil)
  expand-file-name("/ftp:ussir03@uss-irex.info:")
  find-file-noselect("/ftp:ussir03@uss-irex.info:" nil nil t)
  find-file("/ftp:ussir03@uss-irex.info:" t)
  call-interactively(find-file nil nil)

Well, this is a lot. The only thing that strikes me is:
        
  find-file("/ftp:ussir03@uss-irex.info:" t)
  call-interactively(find-file nil nil)
  read-string("Password for ussir03@uss-irex.info: " nil t nil)
  read-passwd("Password for ussir03@uss-irex.info: ")

It seems it finds .authinfo file but can't read it. 

   $ ls -la | grep authinfo
   -rw-r--r--  1 haines haines   1169 Jan 16 11:55 .authinfo

The password has a couple "#" characters in it, so I put it into
quotation marks, but it didn't help.

Haines


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-16 17:18                   ` Haines Brown
@ 2015-01-16 19:59                     ` Michael Albinus
       [not found]                     ` <mailman.18043.1421438398.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 32+ messages in thread
From: Michael Albinus @ 2015-01-16 19:59 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> Running the address returns the request for password, and so .authinfo
> apparently not used. The only thing in the *Messages* buffer is the
> report that I've created customization setup. Only when I do RET in lieu
> of providing a password, do I get a message. 

The ftp method is not handled by Tramp; Tramp redirects all work to
ange-ftp.el. And that package does not use auth-ources, it simply relies
on ~/.netrc.

> Haines

Best regards, Michael.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]                     ` <mailman.18043.1421438398.1147.help-gnu-emacs@gnu.org>
@ 2015-01-16 20:55                       ` Haines Brown
  2015-01-16 21:34                         ` Dan Espen
  2015-01-16 21:36                         ` Michael Albinus
  0 siblings, 2 replies; 32+ messages in thread
From: Haines Brown @ 2015-01-16 20:55 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Albinus <michael.albinus@gmx.de> writes:

> The ftp method is not handled by Tramp; Tramp redirects all work to
> ange-ftp.el. And that package does not use auth-ources, it simply relies
> on ~/.netrc.

Michael, sorry to be so slow on the uptake. For my Emacs 24, ELPA tells
me that ange-ftp is built in, and so I would not expect to see any
ange-ftp.el file. I gather that if I use a tramp command to transfer a
file by ftp, it is authomatically done with ange-ftp.

I presume that since I want to use ftp, I need to define the login in
the .netrc. I have this line there:

  machine uss-irex.info login ussir03 password "Geheim"

I open an emacs session amd issue this command:

  C-x C-f /ftp:issir03@uss-irex.info: 

The messages buffer tells me:

  Waiting for prompts from remote shell
  ssh: connect to host ftp port 22: No route to host.

Can on infer from this that ange-ftp is attempting to log in to the
remote FTP server? But I thought port 22 was SSH? Does "No route" mean
that there is either no such server or account? Is it possible the
hosting service introduced some kind of sercurity measure of which I am
unaware (if there's nothing wrong with what I'm doing at this end, I'll
have to pursue this with them)? 

In *messages* buffer:

  Tramp: Waiting for prompts from remote shell
  Tramp: Sending command `exec ssh   -e none ftp'
  Tramp: Opening connection for ftp using ssh...done
  Tramp: Opening connection for ftp using ssh...
  Tramp: Sending command `exec ssh   -e none ftp'

  Tramp: Waiting for prompts from remote shell
  Tramp: Sending command `exec ssh   -e none ftp'
  Tramp: Opening connection for ftp using ssh...done
  byte-code: Process died

I don't know how to interpret this. It seems ange-ftp wants to execute
ssh session but fails.

Haines  



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-16 20:55                       ` Haines Brown
@ 2015-01-16 21:34                         ` Dan Espen
  2015-01-16 21:36                         ` Michael Albinus
  1 sibling, 0 replies; 32+ messages in thread
From: Dan Espen @ 2015-01-16 21:34 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> The ftp method is not handled by Tramp; Tramp redirects all work to
>> ange-ftp.el. And that package does not use auth-ources, it simply relies
>> on ~/.netrc.
>
> Michael, sorry to be so slow on the uptake. For my Emacs 24, ELPA tells
> me that ange-ftp is built in, and so I would not expect to see any
> ange-ftp.el file. I gather that if I use a tramp command to transfer a
> file by ftp, it is authomatically done with ange-ftp.
>
> I presume that since I want to use ftp, I need to define the login in
> the .netrc. I have this line there:
>
>   machine uss-irex.info login ussir03 password "Geheim"

Unless your password begins and ends with quotes, this is wrong.
Get rid of the quotes.

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-16 20:55                       ` Haines Brown
  2015-01-16 21:34                         ` Dan Espen
@ 2015-01-16 21:36                         ` Michael Albinus
  2015-01-17 12:17                           ` Haines Brown
       [not found]                           ` <mailman.18064.1421497097.1147.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 32+ messages in thread
From: Michael Albinus @ 2015-01-16 21:36 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> Michael, sorry to be so slow on the uptake. For my Emacs 24, ELPA tells
> me that ange-ftp is built in, and so I would not expect to see any
> ange-ftp.el file. I gather that if I use a tramp command to transfer a
> file by ftp, it is authomatically done with ange-ftp.

Yes.

> I presume that since I want to use ftp, I need to define the login in
> the .netrc. I have this line there:
>
>   machine uss-irex.info login ussir03 password "Geheim"
>
> I open an emacs session amd issue this command:
>
>   C-x C-f /ftp:issir03@uss-irex.info: 

I guess it is just a typo. In .netrc you write "ussir03", in the Emacs
file name you write "issir03".
>
> The messages buffer tells me:
>
>   Waiting for prompts from remote shell
>   ssh: connect to host ftp port 22: No route to host.

That shouldn't happen! Could you, please, start a new Emacs stanza with
"emacs -Q" and try then immediately

  C-x C-f /ftp:issir03@uss-irex.info:

> Haines  

Best regards, Michael.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-16 21:36                         ` Michael Albinus
@ 2015-01-17 12:17                           ` Haines Brown
  2015-01-17 17:12                             ` Michael Albinus
       [not found]                             ` <mailman.18073.1421514787.1147.help-gnu-emacs@gnu.org>
       [not found]                           ` <mailman.18064.1421497097.1147.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 32+ messages in thread
From: Haines Brown @ 2015-01-17 12:17 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

On Fri, Jan 16, 2015 at 10:36:42PM +0100, Michael Albinus wrote:
> Haines Brown <haines@histomat.net> writes:
> > The messages buffer tells me:
> >
> >   Waiting for prompts from remote shell
> >   ssh: connect to host ftp port 22: No route to host.
> 
> That shouldn't happen! Could you, please, start a new Emacs stanza with
> "emacs -Q" and try then immediately
> 
>   C-x C-f /ftp:issir03@uss-irex.info:

That "issir03" was just a typo, for I made up a bogus account name and
password as I went along. 

I now start a $ emacs -Q session and:

        C-x C-f /ftp:Benutzer@uss-irex.info:

There is a brief flashed message:

  ~/.netrc either not owned by you or badly protected.

  I suppose this is normal because ~/.netrc is by nature not protected
  at all. I check /etc/group and see I'm a member of the ssh group, but
  not the daemon or ssl-cert groups. 

Then comes a password prompt I suppose because the password from .netrc
was not sent to the web server:

  Password for Benutzer@uss-irex.info:

  There is nothing in *Messages" buffer.

I remake the stanza in ~/.netrc in both column and in line format by
pasting the account name and password directly from the webserver
interface. Here is its format:

        machine uss-irex.info
          login Benutzer
          password Geheim

If at the Password prompt I copy/paste the password from this stanza,
login is successful.

I try all the above on another machine and had same results. 

With a $ emacs -Q session I try:

  M-x customize-variable RET
  Customize variable: auth-source-debug [No  match]

Haines






^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]                           ` <mailman.18064.1421497097.1147.help-gnu-emacs@gnu.org>
@ 2015-01-17 14:13                             ` Dan Espen
  0 siblings, 0 replies; 32+ messages in thread
From: Dan Espen @ 2015-01-17 14:13 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> On Fri, Jan 16, 2015 at 10:36:42PM +0100, Michael Albinus wrote:
>> Haines Brown <haines@histomat.net> writes:
>> > The messages buffer tells me:
>> >
>> >   Waiting for prompts from remote shell
>> >   ssh: connect to host ftp port 22: No route to host.
>> 
>> That shouldn't happen! Could you, please, start a new Emacs stanza with
>> "emacs -Q" and try then immediately
>> 
>>   C-x C-f /ftp:issir03@uss-irex.info:
>
> That "issir03" was just a typo, for I made up a bogus account name and
> password as I went along. 
>
> I now start a $ emacs -Q session and:
>
>         C-x C-f /ftp:Benutzer@uss-irex.info:
>
> There is a brief flashed message:
>
>   ~/.netrc either not owned by you or badly protected.
>
>   I suppose this is normal because ~/.netrc is by nature not protected
>   at all. I check /etc/group and see I'm a member of the ssh group, but
>   not the daemon or ssl-cert groups. 

That message is normal if  you want the file to be ignored:

http://tinyurl.com/nwu3vey

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-17 12:17                           ` Haines Brown
@ 2015-01-17 17:12                             ` Michael Albinus
       [not found]                             ` <mailman.18073.1421514787.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 32+ messages in thread
From: Michael Albinus @ 2015-01-17 17:12 UTC (permalink / raw)
  To: Haines Brown; +Cc: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> With a $ emacs -Q session I try:
>
>   M-x customize-variable RET
>   Customize variable: auth-source-debug [No  match]

Again: ange-ftp.el (which handles ftp connections) does NOT use auth-sources.

Fix your problems with .netrc (proper permissions, maybe all entries in
one line) and it shall work.

> Haines

Best regards, Michael.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
       [not found]                             ` <mailman.18073.1421514787.1147.help-gnu-emacs@gnu.org>
@ 2015-01-17 20:15                               ` Haines Brown
  2015-01-17 23:32                                 ` Dan Espen
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-17 20:15 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Albinus <michael.albinus@gmx.de> writes:

> Fix your problems with .netrc (proper permissions, maybe all entries in
> one line) and it shall work.

Michael, sorry to try your patience. Are you saying the message saying
there is a possible permissions problem with .netrc could somehow be
related to the format of its stanza? In any case. I already had tried
both inline and column format.

I need to do some kind of debug or trace on the command to see just what
is going on, but don't know how to do it.

It seems it is not just password, but the .netrc file that is not being
accessed. For example, with the line in .netrc:

  machine uss-irex.info login Benutzer password Geheim

and accessed with command C-x -C-f /ftp:uss-irex.info, if I understand
the manual correctly, it should log into the Benutzer account. However,
the password prompt I get is: 

    Password for haines@uss-irex.info

The manual suggests my account name (haines) is used if no other account
is specified. This suggests to me that ange-fpt is not seeing the login
information at all.   

A year or two ange-ftp worked. Since then I upgraded debian to Wheezy, Emacs
to emacs 24, and reorganized emacs files (not relevant now because I'm
using $ emacs -Q).

Haines



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-17 20:15                               ` Haines Brown
@ 2015-01-17 23:32                                 ` Dan Espen
  2015-01-18 12:29                                   ` Haines Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Dan Espen @ 2015-01-17 23:32 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Fix your problems with .netrc (proper permissions, maybe all entries in
>> one line) and it shall work.
>
> Michael, sorry to try your patience. Are you saying the message saying
> there is a possible permissions problem with .netrc could somehow be
> related to the format of its stanza? In any case. I already had tried
> both inline and column format.
>
> I need to do some kind of debug or trace on the command to see just what
> is going on, but don't know how to do it.

No you don't.
You already have the problem staring you in the face.

.netrc must have permissions:

-r--------

It won't work any other way.

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-17 23:32                                 ` Dan Espen
@ 2015-01-18 12:29                                   ` Haines Brown
  2015-01-19  2:15                                     ` Dan Espen
  0 siblings, 1 reply; 32+ messages in thread
From: Haines Brown @ 2015-01-18 12:29 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Espen <despen@verizon.net> writes:

> Haines Brown <haines@histomat.net> writes:
>>
>> I need to do some kind of debug or trace on the command to see just what
>> is going on, but don't know how to do it.
>
> No you don't.
> You already have the problem staring you in the face.
>
> .netrc must have permissions:
>
> -r--------
>
> It won't work any other way.

Dan, that was the answer! Now I understand the reason for the
permissions warning message. One would think man netrc would mention
this restriction. 

A primitive -r-------- strikes me as a nuisance because I would have to
go through chmod just to modify the file, but I find that ange-ftp
also works with -rw-------.

Haines


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: run ssh in emacs
  2015-01-18 12:29                                   ` Haines Brown
@ 2015-01-19  2:15                                     ` Dan Espen
  0 siblings, 0 replies; 32+ messages in thread
From: Dan Espen @ 2015-01-19  2:15 UTC (permalink / raw)
  To: help-gnu-emacs

Haines Brown <haines@histomat.net> writes:

> Dan Espen <despen@verizon.net> writes:
>
>> Haines Brown <haines@histomat.net> writes:
>>>
>>> I need to do some kind of debug or trace on the command to see just what
>>> is going on, but don't know how to do it.
>>
>> No you don't.
>> You already have the problem staring you in the face.
>>
>> .netrc must have permissions:
>>
>> -r--------
>>
>> It won't work any other way.
>
> Dan, that was the answer! Now I understand the reason for the
> permissions warning message. One would think man netrc would mention
> this restriction. 

From "man netrc":

  ftp will  abort the auto-login  process if  the .netrc is  readable by
  anyone besides the user.

> A primitive -r-------- strikes me as a nuisance because I would have to
> go through chmod just to modify the file, but I find that ange-ftp
> also works with -rw-------.

Open the file with Emacs.
Just find the file as normal.
To change from read-only type ^x^q.
Make your changes.
Emacs will ask if it's okay when you save the file.

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-01-19  2:15 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 19:32 run ssh in emacs Haines Brown
2015-01-12 19:42 ` Tory S. Anderson
2015-01-13 12:38   ` Haines Brown
2015-01-13 13:04     ` Nikolay Kudryavtsev
2015-01-13 13:18       ` Tory S. Anderson
2015-01-13 13:21       ` Michael Albinus
2015-01-13 13:18     ` Tory S. Anderson
2015-01-13 13:28       ` Michael Albinus
2015-01-13 14:29     ` Tory S. Anderson
2015-01-13 15:16       ` Haines Brown
2015-01-13 15:23         ` Tory S. Anderson
2015-01-13 18:11           ` Haines Brown
2015-01-14  4:26             ` Bob Proulx
     [not found]         ` <mailman.17817.1421162618.1147.help-gnu-emacs@gnu.org>
2015-01-15 16:26           ` Haines Brown
2015-01-15 17:19             ` Ted Zlatanov
2015-01-15 20:26               ` Haines Brown
2015-01-15 21:10                 ` Ted Zlatanov
2015-01-16 17:18                   ` Haines Brown
2015-01-16 19:59                     ` Michael Albinus
     [not found]                     ` <mailman.18043.1421438398.1147.help-gnu-emacs@gnu.org>
2015-01-16 20:55                       ` Haines Brown
2015-01-16 21:34                         ` Dan Espen
2015-01-16 21:36                         ` Michael Albinus
2015-01-17 12:17                           ` Haines Brown
2015-01-17 17:12                             ` Michael Albinus
     [not found]                             ` <mailman.18073.1421514787.1147.help-gnu-emacs@gnu.org>
2015-01-17 20:15                               ` Haines Brown
2015-01-17 23:32                                 ` Dan Espen
2015-01-18 12:29                                   ` Haines Brown
2015-01-19  2:15                                     ` Dan Espen
     [not found]                           ` <mailman.18064.1421497097.1147.help-gnu-emacs@gnu.org>
2015-01-17 14:13                             ` Dan Espen
     [not found]       ` <mailman.17814.1421162216.1147.help-gnu-emacs@gnu.org>
2015-01-13 16:59         ` Dan Espen
     [not found]     ` <mailman.17800.1421154285.1147.help-gnu-emacs@gnu.org>
2015-01-14 12:14       ` Haines Brown
2015-01-14 19:55         ` Bob Proulx

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.