9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] ssh and sam
@ 2000-10-08 14:59 presotto
  0 siblings, 0 replies; 2+ messages in thread
From: presotto @ 2000-10-08 14:59 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

thanks for the fix.  I applied it slighty differently, but with the same
idea.

The message 7 is probably RSA authentication.  The version of ssh you have
was very confused there.  I'll post a better version; sean dorward recently
fixed it, I believe to make possible exactly what you wanted to do but
I'll have to ask.

I tend to send either a simple diff or a complete file.  I don't really
like automatic patches, I'm not that trusting.  Others may/must differ.

I'll stick a note up as soon as I've put an update out there for
ssh with RSA authentication.

[-- Attachment #2: Type: message/rfc822, Size: 4350 bytes --]

From: Micah Stetson <micah@cnm-vra.com>
To: 9fans@cse.psu.edu
Subject: [9fans] ssh and sam
Date: Sun, 8 Oct 2000 02:07:27 -0700
Message-ID: <20001008020727.A32694@cnm-vra.com>

In setting up my system so I can ssh into one of my
GNU/Linux systems using RSA authentication, I had scp tell
me that it encountered a divide error.  (Interestingly
enough, it worked anyway.)  On further investigation, I find
that in /sys/src/cmd/ssh/cmd/client_messages.c, cheight and
cwidth are used uninitialized if request_pty() hasn't been
called.  But request_pty() isn't called unless ssh intends
to start a shell or the user gave it the (undocumented) `-p'
command line option.  So it never gets called when you use
scp.  At the bottom of this message, there's a patch that
makes this problem go away.  However, I am certain that this
is not the One True Solution.  It just made the message go
away, which made me happy enough that I didn't look much
further into it.

Incidentally, what is the right way to apply a patch under
Plan 9?  There is no /bin/patch and the only programs in the
``See Also'' section of diff(1) are cmp and ed.  Am I
missing something, or should I use `diff -e' so the output
can be used by ed?

Not that this is something a person would really want to do,
but if I copy /sys/lib/ssh/hostkey.public10 into the
authorized_keys file on a machine running OpenSSH, I can't
connect to that machine.  ssh dies with this message:
	ssh: Unknown message type 7
I don't suppose anyone will care, but I thought I would
mention it anyway.

The real reason that I was dealing with ssh at all is that I
would like to run the terminal part of sam locally and the
host part on a Unix machine.  My Debian system comes with a
version of sam that says that this is possible, but I think
they have the second edition in mind.  I tried just running
'sam -r', but rx can't seem to talk to Debian.  (I suppose
this makes sense as Debian has no clue about Plan 9 style
authentication.)  After that I recompiled sam to use ssh
instead of rx, figuring (perhaps naively) that it should
work just as well so long as ssh didn't ask for a password.
The ssh manual page suggests enabling TIS_Authentication,
but I don't see any mention of that in the OpenSSH
documentation, so I used RSA authentication instead.  On
trying this, samterm draws its window, but then it is
overwritten by several copies of this message:
	?warning: null characters elided
All of sam's normal menus are there, but the menu items are
in parentheses.  What does this mean?  At that point, I
couldn't make sam respond to much of anything, so I just
killed it.  Is there something I can do to make sam work
with a Unix sam?  I just hope the answer is not ``Port the
latest sam to Unix, because it can't talk to an older
version.''

Micah

/sys/src/cmd/ssh/cmd/client_messages.c:507,508 c /usr/micah/src/ssh/cmd/client_messages.c:507,515
< 	putlong(packet, height/cheight);	/* rows */
< 	putlong(packet, width/cwidth);	/* columns */
---
> 	if(!(cheight && cwidth)) {
> 		putlong(packet, lines = int_env("LINES", 24));	/* rows */
> 		putlong(packet, cols = int_env("COLS", 80));	/* columns */
> 		cwidth = width/cols;
> 		cheight = height/lines;
> 	} else {
> 		putlong(packet, height/cheight);	/* rows */
> 		putlong(packet, width/cwidth);	/* columns */
> 	}



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

* [9fans] ssh and sam
@ 2000-10-08  9:07 Micah Stetson
  0 siblings, 0 replies; 2+ messages in thread
From: Micah Stetson @ 2000-10-08  9:07 UTC (permalink / raw)
  To: 9fans

In setting up my system so I can ssh into one of my
GNU/Linux systems using RSA authentication, I had scp tell
me that it encountered a divide error.  (Interestingly
enough, it worked anyway.)  On further investigation, I find
that in /sys/src/cmd/ssh/cmd/client_messages.c, cheight and
cwidth are used uninitialized if request_pty() hasn't been
called.  But request_pty() isn't called unless ssh intends
to start a shell or the user gave it the (undocumented) `-p'
command line option.  So it never gets called when you use
scp.  At the bottom of this message, there's a patch that
makes this problem go away.  However, I am certain that this
is not the One True Solution.  It just made the message go
away, which made me happy enough that I didn't look much
further into it.

Incidentally, what is the right way to apply a patch under
Plan 9?  There is no /bin/patch and the only programs in the
``See Also'' section of diff(1) are cmp and ed.  Am I
missing something, or should I use `diff -e' so the output
can be used by ed?

Not that this is something a person would really want to do,
but if I copy /sys/lib/ssh/hostkey.public10 into the
authorized_keys file on a machine running OpenSSH, I can't
connect to that machine.  ssh dies with this message:
	ssh: Unknown message type 7
I don't suppose anyone will care, but I thought I would
mention it anyway.

The real reason that I was dealing with ssh at all is that I
would like to run the terminal part of sam locally and the
host part on a Unix machine.  My Debian system comes with a
version of sam that says that this is possible, but I think
they have the second edition in mind.  I tried just running
'sam -r', but rx can't seem to talk to Debian.  (I suppose
this makes sense as Debian has no clue about Plan 9 style
authentication.)  After that I recompiled sam to use ssh
instead of rx, figuring (perhaps naively) that it should
work just as well so long as ssh didn't ask for a password.
The ssh manual page suggests enabling TIS_Authentication,
but I don't see any mention of that in the OpenSSH
documentation, so I used RSA authentication instead.  On
trying this, samterm draws its window, but then it is
overwritten by several copies of this message:
	?warning: null characters elided
All of sam's normal menus are there, but the menu items are
in parentheses.  What does this mean?  At that point, I
couldn't make sam respond to much of anything, so I just
killed it.  Is there something I can do to make sam work
with a Unix sam?  I just hope the answer is not ``Port the
latest sam to Unix, because it can't talk to an older
version.''

Micah

/sys/src/cmd/ssh/cmd/client_messages.c:507,508 c /usr/micah/src/ssh/cmd/client_messages.c:507,515
< 	putlong(packet, height/cheight);	/* rows */
< 	putlong(packet, width/cwidth);	/* columns */
---
> 	if(!(cheight && cwidth)) {
> 		putlong(packet, lines = int_env("LINES", 24));	/* rows */
> 		putlong(packet, cols = int_env("COLS", 80));	/* columns */
> 		cwidth = width/cols;
> 		cheight = height/lines;
> 	} else {
> 		putlong(packet, height/cheight);	/* rows */
> 		putlong(packet, width/cwidth);	/* columns */
> 	}





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

end of thread, other threads:[~2000-10-08 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-08 14:59 [9fans] ssh and sam presotto
  -- strict thread matches above, loose matches on Subject: below --
2000-10-08  9:07 Micah Stetson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).