Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread erik quanstrom
On Sat May 31 12:55:25 EDT 2014, ara...@mgk.ro wrote:
> > I’ve never been able to get the ssh v2 version to work on Plan 9 for 
> > testing.
> 
> Never had any major problem[1] with ssh2 (using the one from labs, with
> factotum, not nfactotum).

the version of factotum is a red herring, as the factotum used
in 9atom, which is a decendent of charles'/rsc's work in the p9p
factotum, was done specificly to support ssh2, and the only version
of factotum used with ssh2 for a few years (up until the public
announcement).

- erik



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread erik quanstrom
> When I manually make this command (what 'hg' does)...
> 
> ssh xxx.yyy.zzz "hg init test"
> 
> 
> ...the result is:
> 
> bash: hg: Command not found...
> 
> 
> When I manually modify it...
> 
> 
> ssh xxx.yyy.zzz 'hg init test'
> 
> ...the result is...
> 
> !Adding key: proto=pass server=xxx.yyy.zzz service=ssh user=pavel
> password:
> !
> 
> ...and the remote repository is successfully created.
> 
> Therefore I though the problem is wrong usage of " instead of ' in the
> mercurial port...

i think you're really close.  hg and python really assume a posix
environment, or windows.  so the plan 9 port uses ape, not the
native environment.  therefore, based on what you're reporting,
i would think that the problem is that hg is not using a bourne-
like shell to execute commands.  which version of hg are you
using?  i'm pretty sure that jeff's version use ape/psh to execute
commands, but not positive.  it must use psh to be posix-y.

- erik



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Steve Simon
FWIW I use ssh2 daily to connect to linux machines,
command line and using sftpfs to get file access.

> one problem with ssh2 is the fact that it doesn't do keyboard interactive at 
> all

One more - sshnet is not yet ported to ssh2, though this is on my list of 
things to do.

-Steve



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Pavel Klinkovský
It seems I do not fully understand the discussion about ssh...

When I manually make this command (what 'hg' does)...

ssh xxx.yyy.zzz "hg init test"


...the result is:

bash: hg: Command not found...


When I manually modify it...


ssh xxx.yyy.zzz 'hg init test'

...the result is...

!Adding key: proto=pass server=xxx.yyy.zzz service=ssh user=pavel
password:
!

...and the remote repository is successfully created.

Therefore I though the problem is wrong usage of " instead of ' in the
mercurial port...

Pavel


Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Brian L. Stuart
> ssh2 doesn't work with passwords (at
> least not without changing server
> settings), you need to use keys.

It does work with real password auth, but current OpenSSH
distros default to not allowing real password auth.  They use
keyboard-interactive instead, and it's set up to look to the
user just like password.  But it's totally antithetical to factotum.
I've thought about doing something to make factotum fake
it for the usual case of keyboard-interactive looking like
password, but it'll be later this summer before I could possible
even look at it.  Of course, anyone else who would like to
do it would gain undying gratitude. :)

As it stands at the moment, the two options are to change
the server config to allow real password instead of fake
password, or use the public key auth.

BLS




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Aram Hăvărneanu
ssh2 doesn't work with passwords (at least not without changing server
settings), you need to use keys.

-- 
Aram Hăvărneanu



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Jeff Sickel

On May 31, 2014, at 1:26 PM, Aram Hăvărneanu  wrote:

> I use secstore to hold my key.

Ah, but I use ssh w/o authorized_keys.  So no, I don’t populate
a key store with a public key.  Just tike `cpu -h somehost` for
the first time, I anticipate that I’ll get a prompt that will only
store a key in factotum after the first session has been connected.

-jas




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Aram Hăvărneanu
On Sat, May 31, 2014 at 8:12 PM, Jeff Sickel  wrote:
> Did you add the key to factotum _before_ using ssh2 to connect?
> I’ve always tried to get factotum to do what it’s suppose to do,
> store the key _after_ using ssh2 to connect to a remote host.

Of course you need to add the key before using ssh2, you can't type a
rsa key by hand not generate it in your head, you need to use
auth/rsagen to generate it.

This is no different then in Unix where you have to generate the
public/private key pair *before* use ssh with key authentication.

The procedure is pretty simple and is described in the "key
management" section of ssh2(1). Use auth/rsagen to generate the key
and add it to factotum, copy the public key from factotum and use
rsa2ssh2 to convert it to the format Unix ssh understands, copy public
key to .ssh/authorized_keys on the Unix host.

I use secstore to hold my key.

-- 
Aram Hăvărneanu



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Jeff Sickel

On May 31, 2014, at 12:07 PM, Aram Hăvărneanu  wrote:

> I didn't do anything more special except adding keys to factotum.

Did you add the key to factotum _before_ using ssh2 to connect?
I’ve always tried to get factotum to do what it’s suppose to do,
store the key _after_ using ssh2 to connect to a remote host.

-jas




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread erik quanstrom
> I didn't do anything more special except adding keys to factotum.

one problem with ssh2 is the fact that it doesn't do keyboard interactive
at all, and doesn't give an error message that makes that apparent.

i've used the client successfully, especially to dell and arista switches.

- erik



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Aram Hăvărneanu
> I too have tried to use it as a client, with zero success.  Thus
> no testing for hg ssh://.

Well what's the problem? "Doesn't work" is not a valid bug report.

cpu% grep ssh /mnt/factotum/ctl
key proto=rsa service=ssh size=1024 ek=2F
n=F856C9BC1E9B881A0CB2DE4CA642A752586010DED7ED729EDEBA54303D4C7EB94C5C8992B48F07508F9DC0409215513B630C0658DC23B64F0A2EC66F411BA874BCF46DCC51E86C2F7644076FB0ACB002D85D28D2BF2493E909CEF373F76E2750E39320B19FCDE02281B4F7F5754BDD8CCD717C97F0071D137E54641E53FDA301
!dk? !p? !q? !kp? !kq? !c2?
cpu% ssh2 -r sunos.mgk.ro
Last login: Sat May 31 07:55:15 2014 from 84.112.126.145
   __.   .
 _|  |_  | .-. .  . .-. :--. |-
|__| ;|   ||  |(.-' |  | |
  |__|   `--'  `-' `;-| `-' '  ' `-'
   /  ; SmartMachine (base64 13.1.0)
   `-'  http://wiki.joyent.com/jpc2/SmartMachine+Base

: 04757c51-b5c2-4d23-9a69-1e9e305bc4da:aram; uname -a
SunOS 04757c51-b5c2-4d23-9a69-1e9e305bc4da.local 5.11
joyent_20131120T074720Z i86pc i386 i86pc Solaris
: 04757c51-b5c2-4d23-9a69-1e9e305bc4da:aram;
: 04757c51-b5c2-4d23-9a69-1e9e305bc4da:aram; logout
cpu%
cpu% srvssh2 iridium
post...
cpu% ls -l /n/iridium/mach_kernel
--rwxr-xr-x M 154 root wheel 8393936 Apr 18 08:03 /n/iridium/mach_kernel
cpu% ssh2 -r iridium
Last login: Sat May 31 12:15:37 2014
: iridium:aram; uname -a
Darwin iridium.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17
23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
: iridium:aram; logout
cpu%

I didn't do anything more special except adding keys to factotum.

-- 
Aram Hăvărneanu



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Jeff Sickel

On May 31, 2014, at 11:20 AM, Aram Hăvărneanu  wrote:

> I'm using it only as a client. I don't see the point in using it in
> other capacity on Plan 9.

I too have tried to use it as a client, with zero success.  Thus
no testing for hg ssh://.

-jas




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread erik quanstrom
On Sat May 31 09:44:35 EDT 2014, pavel.klinkov...@gmail.com wrote:

> Hi Steven,
> 
> For the most part, using HTTP/S repositories will give you the best bang
> > for the proverbial buck.
> 
> 
> I see. In fact I tried to create and use Mercurial repository via 'ssh' and
> 'ftp' (via ftpfs) and none of them works.

jeff also did a port that supports 386 and amd64.  this is a key bit for me, 
since
i don't usually run a 386 or pae kernel.  and it may support arm (it did at one
point).  you can track the tip from jeff's repo.  (sadly they won't include 
proper plan 9 support.)
it does not use openssh, but sadly my copy at least also doesn't work with 
ssh2.  it gets
confused in authentication.

jeff: is this supposed to work?

jeff's version of python has fixed the bug where reads of a plan 9 device 
reporting
0 size always failed.

atta; hg version
Mercurial Distributed SCM (version 2.9.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
atta; python --version
Python 2.7.6
atta; echo $cputype
amd64

- erik



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Aram Hăvărneanu
I'm using it only as a client. I don't see the point in using it in
other capacity on Plan 9.

-- 
Aram Hăvărneanu



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Jeff Sickel

On May 31, 2014, at 11:03 AM, Aram Hăvărneanu  wrote:

>> I’ve never been able to get the ssh v2 version to work on Plan 9 for testing.
> 
> Never had any major problem[1] with ssh2 (using the one from labs, with
> factotum, not nfactotum).

Are you running it on your auth server?  I’m not, don’t want to ssh in or
out to my auth server, but other cpu servers would be nice.

I can’t get [1] connections in, and [2] ssh2 to call out.  So no, I clearly
don’t have a configuration, or the right documentation, to support it enough
for testing hg ssh://.

-jas




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Aram Hăvărneanu
> I’ve never been able to get the ssh v2 version to work on Plan 9 for testing.

Never had any major problem[1] with ssh2 (using the one from labs, with
factotum, not nfactotum).

[1] a small problem is that I needed to patch srvssh like this:
http://okturing.com/src/2230/body

-- 
Aram Hăvărneanu



Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Jeff Sickel

On May 31, 2014, at 8:43 AM, Pavel Klinkovský  
wrote:

> Hi Steven,
> 
> For the most part, using HTTP/S repositories will give you the best bang for 
> the proverbial buck.
> 
> I see. In fact I tried to create and use Mercurial repository via 'ssh' and 
> 'ftp' (via ftpfs) and none of them works.

Pavel,

The latest Python 2.7.x and Mercurial port hasn’t had any testing or 
configuration done
to support ssh.  That’s partially for two reasons:

1) I have no hosts supporting ssh v1 any more, nor any remote hg 
repository
   services with ssh v1.

2) I’ve never been able to get the ssh v2 version to work on Plan 9 for 
testing.

Once ssh v2 is more easily configurable on Plan 9 it wouldn’t take much to 
validate sshcmd
and sshargs are prepared properly to access remote services.

-jas




Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Pavel Klinkovský
Hi Steven,

For the most part, using HTTP/S repositories will give you the best bang
> for the proverbial buck.


I see. In fact I tried to create and use Mercurial repository via 'ssh' and
'ftp' (via ftpfs) and none of them works.

Pavel


Re: [9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Steven Stallion
On Sat, May 31, 2014 at 7:41 AM, Pavel Klinkovský
 wrote:
> Hi all,
>
> I am using native Plan9.

Hi Pavel,

Internally, Mercurial makes calls to OpenSSH, which doesn't quite work
as advertised on Plan 9. For the most part, using HTTP/S repositories
will give you the best bang for the proverbial buck. When I worked on
the original port, SSHv2 had not been released yet - now that it's out
there and is working it may be time to fix this hole in the port.

Cheers,

Steve



[9fans] Mistake in Plan9 Mercual port?

2014-05-31 Thread Pavel Klinkovský
Hi all,

I am using native Plan9.

I tried to create a remote Mercurial repository via 'ssh':

term% hg init ssh://xxx.yyy.zzz/test --verbose
running ssh xxx.yyy.zzz "hg init test"
running ssh xxx.yyy.zzz "hg -R test serve --stdio"
remote: abort: Bad file number
abort: no suitable response from remote hg!


Should not it be?

running ssh xxx.yyy.zzz *'*hg init test*'*
running ssh xxx.yyy.zzz *'*hg -R test serve --stdio*'*


Pavel