help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: SSH blocks account when running within emacs


From: Bob Proulx
Subject: Re: SSH blocks account when running within emacs
Date: Sat, 1 Dec 2012 01:13:51 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

Roel Sergeant wrote:
> I tried this on a non-production setup and up to now no solution,
> but I did find the following using the verbose option on ssh:
> 
> debug1: Next authentication method: password
> debug1: read_passphrase: can't open /dev/tty: Device not configured

Ouch.  That seems like the root of the problem.  No tty so can't ask
for a password.

> So it seems from within emacs it can't read from /dev/tty. Outside emacs
> this works (I'm assuming it either finds /dev/tty or uses the actual device
> needed).

It will use the tty device.  You can tell which device by using the
'tty' command.  Such as this example from my machine.

  $ tty
  /dev/pts/39

> From env I have the following related to terminals..
> 
> In emacs:
> TERM=dumb
> SSH_TTY=/dev/pts/0

TERM=dumb is normal within a '*shell*' window.  I am not familiar with
SSH_TTY but wonder if that environment variable is simply in the
environment from when emacs is started and unrelated to the current
shell running in the emacs inferior process.

> In a normal shell:
> TERM=screen -or- TERM=linux
> SSH_TTY=/dev/pts/0
> 
> Any ideas?

Be sure to try this with 'emacs -Q' to test it without any startup
files.  Just in case a startup file has overridden the installation in
some way that is breaking you.

I know you said you were running emacs 24.2.1 on NetBSD.  Seems like
that should operate okay there.  I am running emacs 23.2.1 on Debian
Squeeze.  In that and previous versions of emacs 'M-x shell' starts up
a shell and in that shell a pty is associated with it.  I can very
this by running 'tty' to produce the name of it and 'test -t 0' shows
a pty as in this example below.

  $ test -t 0 && echo yes tty || echo no tty
  yes tty

I can only suggest taking it up with the NetBSD maintainer and ask
about how emacs was built for your platform.  It should work, but
doesn't, so why not?  Or of course you could grab the source and build
it yourself.  But it appears that emacs on your platform is not going
to have a tty available for some reason.

I would also try 'M-x term' too.  That should definitely spawn an
associated pty device since that is the entire point of it.  Read the
documentation on the emulator since the emacs keys are necessarily
nested.  Hint: Within emacs try "C-h r g terminal emulator" to read
the documentation.  Note that C-c is the escape character.  All other
control characters are sent to the shell.  So you need to know how to
get out of that mode before using that mode.  I routinely run M-x term
and then C-c C-j to swith to line mode so that normal emacs keys are
enabled again and then C-c C-k to switch back when I want to send
control keys to the inferior shell process.

Bob



reply via email to

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