Page 1 of 1

ssh X forwarding

Posted: 07 Nov 2014, 16:12
by dan1
Hi,

I'm new to porteus, have sparely used slax before- but am by no neans an expert ... So I've installed porteus with razor using unetbootin to usb and bootet it fresh. Now I want to log in to the system via ssh. Started sshd by changing the permission pf /etc/rc.d/rc.sshd to executable
guest# sudo chmod +x /etc/rc.d/rc.sshd
and than executed
guest# sudo /etc/rc.d/rc.sshd start
ssh keys get genegatet at the first run... fine.

Next I log in to porteus from a remote machine (Ubuntu LTS 14.04)
# ssh -Y guest@porteus
and get no X forwarding in ssh. The output of ssh -vv [..] is listed below.
What could be the problem here? The remote display is not added to my xauth file on the porteus machine.
# xauth list
porteus/unix:0 MIT-MAGIC-COOKIE-1 8d9f3beb26c33d8d50c00be4ff128b2e
and I'm not quite sure how to add it manually.
From another machine (Ubuntu-Ubuntu and Ubuntu-Cygwin) it worked flawlessly.

Any suggestions? :wink:

Code: Select all

--------------- output of ssh login ----------------------------------
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/danaur/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.122.138 [192.168.122.138] port 22.
debug1: Connection established.
debug1: identity file /home/danaur/.ssh/id_rsa type 1
debug1: identity file /home/danaur/.ssh/id_rsa-cert type -1
debug1: identity file /home/danaur/.ssh/id_dsa type -1
debug1: identity file /home/danaur/.ssh/id_dsa-cert type -1
debug1: identity file /home/danaur/.ssh/id_ecdsa type -1
debug1: identity file /home/danaur/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/danaur/.ssh/id_ed25519 type -1
debug1: identity file /home/danaur/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup hmac-md5-etm@openssh.com
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug2: mac_setup: setup hmac-md5-etm@openssh.com
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA dc:09:76:4d:23:87:1a:8f:1c:55:cb:d7:0e:1b:bc:1c
debug1: Host '192.168.122.138' is known and matches the ECDSA host key.
debug1: Found key in /home/danaur/.ssh/known_hosts:9
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/danaur/.ssh/id_rsa (0x7f8a1172b260),
debug2: key: /home/danaur/.ssh/id_dsa ((nil)),
debug2: key: /home/danaur/.ssh/id_ecdsa ((nil)),
debug2: key: /home/danaur/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/danaur/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/danaur/.ssh/id_dsa
debug1: Trying private key: /home/danaur/.ssh/id_ecdsa
debug1: Trying private key: /home/danaur/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
guest@192.168.122.138's password: 
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to 192.168.122.138 ([192.168.122.138]:22).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: x11_get_proto: /usr/bin/xauth  list :0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LC_PAPER = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_ADDRESS = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MONETARY = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_NUMERIC = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_TELEPHONE = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_IDENTIFICATION = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MEASUREMENT = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_TIME = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_NAME = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 100 id 0
X11 forwarding request failed on channel 0
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Fri Nov  7 16:47:26 2014 from danaur-linux.intern
-------------- ssh login output end ---------------------------
------------

Re: ssh X forwarding

Posted: 07 Nov 2014, 20:52
by fanthom
hi dan1,

i cant check right now but there is a chance that X11 forwarding is disabled in the /etc/ssh/sshd_config file.

btw: please use

Code: Select all

 tag when pasting a log files.

thanks

Re: ssh X forwarding

Posted: 10 Nov 2014, 12:17
by dan1
Hi fanthom,

Thanks for the fast reply, I was afk over the weekend :D. I've already uncommented in /etc/ssh/ssh_config

Code: Select all

Host *
   ForwardAgent yes
   ForwardX11 yes
and restarted sshd
# sudo /etc/rc.d/rc.sshd stop
# sudo /etc/rc.d/rc.sshd start

Is there a setting I could have missed?

Re: ssh X forwarding

Posted: 10 Nov 2014, 21:31
by fanthom
please follow this doc and let us know if anything worked for you:
https://wiki.archlinux.org/index.php/Se ... forwarding

Re: ssh X forwarding

Posted: 12 Nov 2014, 09:36
by dan1
Hi,

I wrote a quite well formated comment about how I tried every possibillity from your arch wiki page and nothing changes but hit {tab} and {backspace} by mistake and it was gone ... :O:

So let's just say nothing of the suggested worked. Did anyone reproduce the error or am I the only one?

Re: ssh X forwarding

Posted: 12 Nov 2014, 21:13
by fanthom
works here.

i have changed only these options on the server side:

Code: Select all

AllowAgentForwarding yes
AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
restarted sshd and then connected with following command from the client:

Code: Select all

ssh -X guest@192.168.1.2
now i could start any GUI app and see it locally.

Re: ssh X forwarding

Posted: 12 Nov 2014, 23:36
by Ed_P
dan1 wrote:I wrote a quite well formated comment about how I tried every possibillity from your arch wiki page and nothing changes but hit {tab} and {backspace} by mistake and it was gone ... :O:
Been there, done that. Sometimes, RIGHT clicking in the text area gives you the option to Undo.

Re: ssh X forwarding

Posted: 13 Nov 2014, 17:23
by dan1
OK, my bad.. :roll:

Hint in my face was

Code: Select all

/etc/ssh/ssh_config: line 21: Bad configuration option: allowagentforwarding
/etc/ssh/ssh_config: line 22: Bad configuration option: allowtcpforwarding
/etc/ssh/ssh_config: line 23: Bad configuration option: x11forwarding
/etc/ssh/ssh_config: line 24: Bad configuration option: x11displayoffset
/etc/ssh/ssh_config: line 25: Bad configuration option: x11uselocalhost
/etc/ssh/ssh_config: terminating, 5 bad configuration options
when I tried to ssh the other way around, from porteus to ubuntu. I was editing the wong config file, /etc/ssh/ssh_config instead of /etc/ssh/sshd_config. I never realized the mistake because I was only connecting from ubuntu to porteus. The porteus ssh server config never changed and the porteus ssh client config was never parsed.

Sorry for the trouble. :oops: