JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for MOONSHOT-COMMUNITY Archives


MOONSHOT-COMMUNITY Archives

MOONSHOT-COMMUNITY Archives


MOONSHOT-COMMUNITY@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

MOONSHOT-COMMUNITY Home

MOONSHOT-COMMUNITY Home

MOONSHOT-COMMUNITY  November 2011

MOONSHOT-COMMUNITY November 2011

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Not able to use moonshot-ssh from a remote host

From:

Brian Abram <[log in to unmask]>

Reply-To:

Moonshot community list <[log in to unmask]>, Brian Abram <[log in to unmask]>

Date:

Sat, 12 Nov 2011 14:40:48 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (199 lines)

Not able to use moonshot-ssh from a remote host

I thought it would be useful exercise to run a remote moonshot shell
from my home moonshotized VM to the test VM at the office through a tunnel.
This was to understand whether or not moonshot-ssh is relevant to my user-case.
My user-case is that a guest can be given privileges to work on a client inside duckworld
via ssh using their existing pan-European user identity

It occurred to me that if I am modifying the sshd pam stack to use pam_gss,
perhaps I am ignoring what moonshot-ssh already has to offer.
I was interested to know if moonshot-ssh would do what pam_gss does with regards
to GSSAPI. However, moonshot-ssh should be run from outside the firewall
and pam stack changes are on the target client inside the firewall.

First I set up the config file to allow me to either connect using
the standard ssh/sshd or the moonshot ssh/sshd
I did not try to use the moonshot client with the standard sshd
or the standard client with the moonshot-ssh server.

First I tunnelled in using the standard ssh
which gave me the fingerprints for the server,
established the tunnel and port forwarding.

Note:
The GSS settings in the config file require keys,
but we did not store any keys in steve's .ssh/ folder when we set up moonshot,
instead we had a .gss_eap_id containing username/password.
So I created the same file on my local steve account.

I exited out of 'steve's remote ssh shell then tried getting a moonshot ssh connection.
The result is below, but the debugging suggests it requires local steve to have keys set-up.
Which appears to be different behaviour to running directly on the target host.
Anyway, that already answered one question as our 
guest users are concerned as they won't be using this method of authentication.

However, what happens if keys are created on my local steve's account?
The result was unexpected and follows below.
The key was found but there was a complaint about the format.

In conclusion, my user case requires users to use the standard ssh/sshd
along with changes to the pam stack and username/password.

------------------------------------------------------------------------
Extracts from .ssh/config are appended
(some usernames and host names/ip addresses have been changed)
------------------------------------------------------------------------
Session history follows: 

[steve@localhost ~]$ ssh -f -q -N nxuser; ssh steve22testshib2
The authenticity of host 'localnxuser (111.111.222.2)' can't be established.
RSA key fingerprint is ff:f9:be:96:ff:b9:f4:d7:8c:ec:9d:e1:45:c9:fb:68.
Are you sure you want to continue connecting (yes/no)? yes
[log in to unmask] password: 
The authenticity of host 'localtestshib2 ([127.0.0.1]:22201)' can't be established.
RSA key fingerprint is 3b:54:14:77:30:3f:47:f1:d7:52:38:61:1d:2b:da:f6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localtestshib2' (RSA) to the list of known hosts.
steve@localhost's password: 
Last login: Fri Nov 11 15:09:24 2011 from localhost.localdomain
[steve@sci-ws006 ~]$ whoami
steve
[steve@sci-ws006 ~]$
[steve@sci-ws006 ~]$ exit
logout
Connection to localhost closed.
---------------------------------------------------------------
[steve@localhost ~]$ 
[steve@localhost ~]$ cat .gss_eap_id 
steve
testing
----------------------------------------------------------------
[steve@localhost ~]$ whereis ssh
ssh: /usr/bin/ssh /etc/ssh /opt/moonshot/bin/ssh /usr/share/man/man1/ssh.1.gz
[steve@localhost ~]$ /opt/moonshot/bin/ssh moonssh2222
ssh_exchange_identification: Connection closed by remote host
[steve@localhost ~]$ 
[steve@localhost ~]$ /opt/moonshot/bin/ssh -vvv moonssh2222
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /home/steve/.ssh/config
debug1: Applying options for moonssh2222
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22202.
debug1: Connection established.
debug1: identity file /home/steve/.ssh/identity type -1
debug1: identity file /home/steve/.ssh/id_rsa type -1
debug1: identity file /home/steve/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
[steve@localhost ~]$ 
[steve@localhost ~]$ /opt/moonshot/bin/ssh  -l "" moonssh2222  
ssh_exchange_identification: Connection closed by remote host
[steve@localhost ~]$ /opt/moonshot/bin/ssh  -l steve  moonssh2222  
ssh_exchange_identification: Connection closed by remote host
[steve@localhost ~]$ 
--------------------------------------------------------
[steve@localhost ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/steve/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/steve/.ssh/id_rsa.
Your public key has been saved in /home/steve/.ssh/id_rsa.pub.
The key fingerprint is:
dd:ca:3a:b6:d7:5e:8d:01:33:96:d0:bc:87:9d:28:61 [log in to unmask]
The key's randomart image is:
+--[ RSA 2048]----+
|          .o     |
|          E.o.   |
|         . .*= . |
|         ..o+++  |
|        S .....  |
|         . .   + |
|          o.  o .|
|        o.. ..   |
|       .o+ ..    |
+-----------------+
[steve@localhost ~]$
----------------------------------------------------------
[steve@localhost ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub steve22testshib2

[steve@localhost ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub steve22testshib2
steve@localhost's password: 
Now try logging into the machine, with "ssh 'steve22testshib2'", and check in:

  .ssh/authorized_keys

[steve@localhost ~]$ ssh steve22testshib2
steve@localhost's password: 
Last login: Sat Nov 12 09:24:08 2011 from cs04r-sc-serv-46.duckworld.ac.uk
[steve@sci-ws006 ~]$ cat .ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0zcYFvBbkq/ydbnPC1HWR42YsH3nEB+ReI6BoEGxXBw98BN6rmHoPY81P8S+FuUTfGIH+a4JR9YHieW8xlcGMXpkgbkQu0OfAwa/qZs5U0VS4m5rmvV1wUtS9UToTI55OEkM3/ORt4AfYVhiVpINRo7u7Wbo6FtafpPSmoDueb1tGkxzH/YMNtWWdfYsjCOEwd8PkpuOkzbzXNUoRra4XxF8oo+C0wAptssm8ABP4bL69tC+9p5zXZgCmK45s3/yA+bL6v5EKvSZ/zDTq908nYkD3gp6voh7Xz2x9gzefHV4wkApQn3C4vNirb9jsfUx0ERGioCTsKMkQKGWLWKsyQ== [log in to unmask]
[steve@sci-ws006 ~]$ exit
logout
Connection to localhost closed.
[steve@localhost ~]$ 
------------------------------------------------------------------
[steve@localhost ~]$ /opt/moonshot/bin/ssh  -vvv -l "" moonssh2222  
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /home/steve/.ssh/config
debug1: Applying options for moonssh2222
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22202.
debug1: Connection established.
debug1: identity file /home/steve/.ssh/identity type -1
debug3: Not a RSA1 key file /home/steve/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
<snip>
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/steve/.ssh/id_rsa type 1
debug1: identity file /home/steve/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
[steve@localhost ~]$ 
=========================================================
extract from .ssh/config:

Host nxuser
HostName nx-user.duckworld.ac.uk
	Port 22
        User dduck69
        HostKeyAlias localnxuser
        LocalForward 22122 testshib1.duckworld.ac.uk:22
        LocalForward 22389 testshib1.duckworld.ac.uk:389
        LocalForward 22201 testshib2.duckworld.ac.uk:22
        LocalForward 22202 testshib2.duckworld.ac.uk:2222
        LocalForward 22322 sci-ws006.duckworld.ac.uk:22

Host testshib1
HostName localhost
        User brian
        Port 22122
        HostKeyAlias localtestshib1

Host testshib2
HostName localhost
        User brian
        Port 22201
        HostKeyAlias localtestshib2

Host steve22testshib2
HostName localhost
        User steve
        Port 22201
        HostKeyAlias localtestshib2

Host moonssh2222
HostName localhost
	GSSAPIKeyExchange yes
	GSSAPIAuthentication yes
        # # # User steve
        Port 22202
        HostKeyAlias localtest2222

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2022
December 2021
October 2021
September 2021
August 2021
June 2021
April 2021
February 2021
January 2021
December 2020
November 2020
October 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
January 2020
November 2019
October 2019
September 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
June 2018
April 2018
November 2017
October 2017
September 2017
August 2017
July 2017
May 2017
April 2017
March 2017
February 2017
November 2016
October 2016
August 2016
July 2016
June 2016
May 2016
March 2016
February 2016
January 2016
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager