<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-50</id>
	<title>Nabble - SSH (Secure Shell)</title>
	<updated>2009-11-24T02:05:00Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/SSH-(Secure-Shell)-f50.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SSH-%28Secure-Shell%29-f50.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26503387</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-11-24T02:05:00Z</published>
	<updated>2009-11-24T02:05:00Z</updated>
	<author>
		<name>Alexander Klimov</name>
	</author>
	<content type="html">On Mon, 19 Oct 2009, Adriana Rodean wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I always do a remote port forwarding with openssh on 1026 port let's
&lt;br&gt;&amp;gt; say ( ssh -R 1026:localhost:55555 ). Most times the port is opened on
&lt;br&gt;&amp;gt; remote machine. But sometimes i notice that ssh can't do remote port
&lt;br&gt;&amp;gt; forwarding to that port 1026. I looked on the remote machine (netstat
&lt;br&gt;&amp;gt; -an) and no one is using that port, so the port is free.
&lt;br&gt;&amp;gt; Only way to fix this is do a remote port forwarding to another port
&lt;br&gt;&amp;gt; lets say 1056, successfully done, then try again and do it for 1026,
&lt;br&gt;&amp;gt; this time remote port forwarding successfully works... Sometimes it
&lt;br&gt;&amp;gt; works if i try again with 1026, but other times i need to open another
&lt;br&gt;&amp;gt; port then try again with 1026 port...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [..]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I use version of OpenSSH 5.1p1 on remote machine and the client is
&lt;br&gt;&amp;gt; OpenSSH for Windows 3.8.1p1
&lt;/div&gt;&lt;br&gt;Nobody uses the port, but it is still in TIME_WAIT state.
&lt;br&gt;Usually openssh uses SO_REUSEADDR to say the kernel that the
&lt;br&gt;port can be reused while in TIME_WAIT state, but to avoid X11
&lt;br&gt;man-in-the-middle attack the portable version of OpenSSH
&lt;br&gt;5.1 does not set it if you have X11UseLocalhost=no.
&lt;br&gt;&lt;br&gt;So, you should either wait a little after each closing of the
&lt;br&gt;port before trying to use it again, or set X11UseLocalhost=yes.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Regards,
&lt;br&gt;ASK
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p26503387.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26343060</id>
	<title>Re: Remotely replaced sshd_config, CentOS 5.3/SSH 4.3p2-36el5_4.2</title>
	<published>2009-11-13T09:08:50Z</published>
	<updated>2009-11-13T09:08:50Z</updated>
	<author>
		<name>Adam Hubscher-2</name>
	</author>
	<content type="html">68.50.70.187 is the attackers' IP.
&lt;br&gt;&lt;br&gt;Leif Nixon wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Adam Hubscher &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26343060&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;offbeatadam@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; These servers run cPanel and have been updated to the following
&lt;br&gt;&amp;gt;&amp;gt; specs:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 2.6.18-164.el5PAE #1 SMP Thu Sep 3 04:10:44 EDT 2009 i686 i686 i386
&lt;br&gt;&amp;gt;&amp;gt; GNU/Linux
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This seems vulnerable to CVE-2009-3547 and CVE-2009-2695. If SELinux is
&lt;br&gt;&amp;gt; enabled, you can trivially get root on these machines if you can run
&lt;br&gt;&amp;gt; commands as a logged in user.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I would start by looking very hard at all successful ssh logins the
&lt;br&gt;&amp;gt; hours before the known intrusion. It is very possible that some of them
&lt;br&gt;&amp;gt; are performed using stolen ssh keys.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I have logs from these servers, if you need other information to
&lt;br&gt;&amp;gt;&amp;gt; possibly help track this down that is possible. I'm having a hard time
&lt;br&gt;&amp;gt;&amp;gt; finding the vector for this attack though...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If you could share the IP number of the attacking host, that could be
&lt;br&gt;&amp;gt; useful. Does /root/.bash_history contain anything interesting? Is there
&lt;br&gt;&amp;gt; anything suspicious in /dev/shm? (There won't be, if the machine has
&lt;br&gt;&amp;gt; been rebooted after the intrusion.)
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (4K) &lt;a href=&quot;http://old.nabble.com/attachment/26343060/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Remotely-replaced-sshd_config%2C-CentOS-5.3-SSH-4.3p2-36el5_4.2-tp26339495p26343060.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26343033</id>
	<title>Re: Remotely replaced sshd_config, CentOS 5.3/SSH 4.3p2-36el5_4.2</title>
	<published>2009-11-13T08:46:33Z</published>
	<updated>2009-11-13T08:46:33Z</updated>
	<author>
		<name>Maccy</name>
	</author>
	<content type="html">2009/11/12 Adam Hubscher &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26343033&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;offbeatadam@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; Early (around midnight-1am CST) this morning we had a widespread attack via
&lt;br&gt;&amp;gt; an unknown vector. In the attack, the only thing that I can find is the
&lt;br&gt;&amp;gt; following (IP blacked out, although it is the attackers' address):
&lt;br&gt;&lt;br&gt;A couple of colleagues at UK universities have reported seeing things
&lt;br&gt;similar to the following (they run RHEL5/CentOS/Scientific Linux) :-
&lt;br&gt;&lt;br&gt;A user account was used to log in from two sites:
&lt;br&gt;&lt;br&gt;195.22.101.220 (server14.Xuna.nl)
&lt;br&gt;195.22.100.126 (server12.xuna.nl)
&lt;br&gt;&lt;br&gt;On the compromised systems (RHEL5) the ssh and sshd binaries were
&lt;br&gt;replaced with ones that logged username and plain text password
&lt;br&gt;information to a file called /etc/X11/fonts/misc/s1
&lt;br&gt;&lt;br&gt;The new ssh and sshd had the dates set to the originals, but they didn't
&lt;br&gt;have a and i attributes set. Their new sizes were
&lt;br&gt;&lt;br&gt;&amp;nbsp;334768 /usr/bin/ssh
&lt;br&gt;&amp;nbsp;445512 /usr/sbin/sshd
&lt;br&gt;&lt;br&gt;The output of 'strings /usr/sbin/sshd' included the following:
&lt;br&gt;&lt;br&gt;&amp;nbsp;/etc/X11/fonts/misc/S1
&lt;br&gt;&amp;nbsp;/etc/X11/fonts/misc/s1
&lt;br&gt;&amp;nbsp;/etc/X11/fonts/misc/s1.tmp
&lt;br&gt;&amp;nbsp;rm -rf /etc/X11/fonts/misc/s1; cp /etc/X11/fonts/misc/s1.tmp
&lt;br&gt;/etc/X11/fonts/misc/s1; chmod o+w /etc/X11/fonts/misc/s1; rm -rf
&lt;br&gt;/etc/X11/fonts/misc/s1.tmp
&lt;br&gt;&amp;nbsp;/usr/X11R6/bin/xauth
&lt;br&gt;&amp;nbsp;no-X11-forwarding
&lt;br&gt;&lt;br&gt;and 'strings /usr/sbin/ssh' included:
&lt;br&gt;&lt;br&gt;&amp;nbsp;/etc/X11/fonts/misc/S1
&lt;br&gt;&amp;nbsp;/etc/X11/fonts/misc/s1
&lt;br&gt;&lt;br&gt;Where a compromised system had had the openssh-server and openssh-clients
&lt;br&gt;rpms updated after the compromise, 'rpm -V' on openssh-server and
&lt;br&gt;openssh-clients looked ok (but the /etc/X11/fonts/misc/s1 file still
&lt;br&gt;existed).
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Mark
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Remotely-replaced-sshd_config%2C-CentOS-5.3-SSH-4.3p2-36el5_4.2-tp26339495p26343033.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26339495</id>
	<title>Remotely replaced sshd_config, CentOS 5.3/SSH 4.3p2-36el5_4.2</title>
	<published>2009-11-12T09:55:37Z</published>
	<updated>2009-11-12T09:55:37Z</updated>
	<author>
		<name>Adam Hubscher-2</name>
	</author>
	<content type="html">Hello Everyone,
&lt;br&gt;&lt;br&gt;Fighting a bit of a nasty morning... anyone seen this before?
&lt;br&gt;&lt;br&gt;We have a number of servers that have password authentication disabled 
&lt;br&gt;as well as shell access disabled for all users except those whom have 
&lt;br&gt;keys. These servers run cPanel and have been updated to the following specs:
&lt;br&gt;&lt;br&gt;2.6.18-164.el5PAE #1 SMP Thu Sep 3 04:10:44 EDT 2009 i686 i686 i386 
&lt;br&gt;GNU/Linux
&lt;br&gt;openssh-4.3p2-36.el5_4.2
&lt;br&gt;&lt;br&gt;Early (around midnight-1am CST) this morning we had a widespread attack 
&lt;br&gt;via an unknown vector. In the attack, the only thing that I can find is 
&lt;br&gt;the following (IP blacked out, although it is the attackers' address):
&lt;br&gt;&lt;br&gt;Nov 12 04:31:22 sharedserver/sharedserver sshd[16083]: Received 
&lt;br&gt;disconnect from 100.100.100.100: 11: No supported authentication methods 
&lt;br&gt;available
&lt;br&gt;Nov 12 04:32:14 sharedserver/sharedserver sshd[11265]: Received signal 
&lt;br&gt;15; terminating.
&lt;br&gt;Nov 12 04:32:14 sharedserver/sharedserver sshd[16570]: Server listening 
&lt;br&gt;on :: port 2.
&lt;br&gt;Nov 12 04:32:14 sharedserver/sharedserver sshd[16570]: error: Bind to 
&lt;br&gt;port 2 on 0.0.0.0 failed: Address already in use.
&lt;br&gt;Nov 12 04:32:27 sharedserver/sharedserver sshd[16611]: Accepted password 
&lt;br&gt;for root from 100.100.100.100 port 3630 ssh2
&lt;br&gt;Nov 12 04:32:27 sharedserver/sharedserver sshd[16611]: 
&lt;br&gt;pam_unix(sshd:session): session opened for user root by (uid=0)
&lt;br&gt;&lt;br&gt;&lt;br&gt;The concerning part is that it obviously appears that there is someone 
&lt;br&gt;reloading SSHD, but there is no successful login (at all) via shell 
&lt;br&gt;prior to this.
&lt;br&gt;&lt;br&gt;This time corresponds with a modified sshd_config that then allows 
&lt;br&gt;password authentication, whereby the user then logs in as root and has a 
&lt;br&gt;good time, so to speak.
&lt;br&gt;&lt;br&gt;I know that the following vulnerability is out in the wild:
&lt;br&gt;&lt;br&gt;Linux Kernel 'sock_sendpage()' NULL Pointer Dereference Vulnerability
&lt;br&gt;&lt;br&gt;However, since the user never actually logged into the server from what 
&lt;br&gt;I can see, I'm still searching for the real way that this occurred.
&lt;br&gt;&lt;br&gt;I have logs from these servers, if you need other information to 
&lt;br&gt;possibly help track this down that is possible. I'm having a hard time 
&lt;br&gt;finding the vector for this attack though...
&lt;br&gt;&lt;br&gt;Any assistance would be greatly appreciated.
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (4K) &lt;a href=&quot;http://old.nabble.com/attachment/26339495/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Remotely-replaced-sshd_config%2C-CentOS-5.3-SSH-4.3p2-36el5_4.2-tp26339495p26339495.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26322271</id>
	<title>SOLUTION ! [BUG?] sshd closes the connection after 2^16 bytes</title>
	<published>2009-11-12T01:15:50Z</published>
	<updated>2009-11-12T01:15:50Z</updated>
	<author>
		<name>Matthieu Moy-4</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;Rather unbelievable, but upgrading the _kernel_ from 2.6.18-128.7.1 to
&lt;br&gt;2.6.18-164.6.1 fixed the problem (we had good reasons not to upgrade,
&lt;br&gt;but we worked around them).
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;Matthieu Moy &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26322271&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Matthieu.Moy@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm having trouble with the sshd on one particular machine. In short:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (the 65536 here should have been a 196481 ...)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This happens whether I launch the command from the machine, or from
&lt;br&gt;&amp;gt; another remote machine. The OpenSSH version is:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; with:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ cat /etc/redhat-release 
&lt;br&gt;&amp;gt; Red Hat Enterprise Linux Server release 5.4 (Tikanga)
&lt;br&gt;&amp;gt; $ uname -a
&lt;br&gt;&amp;gt; Linux machine-name 2.6.18-128.7.1.el5 #1 SMP Wed Aug 19 04:08:13 EDT 2009 ppc64 ppc64 ppc64 GNU/Linux
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One surprising thing:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&amp;gt; $ head -c 196480 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp;196480
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, the bug is triggered when sending 196481 bytes or more, but the
&lt;br&gt;&amp;gt; consequence is a truncation of the input at 65536=2^16 bytes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any idea what's going on?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (please, keep me Cc-ed, I didn't subscribe to the list)
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;Matthieu Moy
&lt;br&gt;&lt;a href=&quot;http://www-verimag.imag.fr/~moy/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-verimag.imag.fr/~moy/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SOLUTION-%21--BUG---sshd-closes-the-connection-after-2%5E16-bytes-tp26322271p26322271.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26309288</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-11T10:34:25Z</published>
	<updated>2009-11-11T10:34:25Z</updated>
	<author>
		<name>Darren Tucker</name>
	</author>
	<content type="html">On Wed, Nov 11, 2009 at 11:01:28AM +0100, Vincenzo Romano wrote:
&lt;br&gt;&amp;gt; It's not yet working though.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If I enable the GatewayPorts on the sshd_config (not ssh_config), then
&lt;br&gt;&amp;gt; no RPF works anymore on the dummy interfaces or the loopback.
&lt;br&gt;&amp;gt; They all fail with:
&lt;br&gt;&amp;gt; Warning: remote port forwarding failed for listen port 139, despite
&lt;br&gt;&amp;gt; there's no process listening on that interface and that port.
&lt;br&gt;&lt;br&gt;In your original example you had &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26309288&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&amp;quot;. &amp;nbsp;If &amp;quot;user&amp;quot; is
&lt;br&gt;not root then you probably don't have permissions to bind to
&lt;br&gt;low-numbered ports (with or without sshd).
&lt;br&gt;&lt;br&gt;If that's not it, I suggest running the server in debug mode
&lt;br&gt;(eg /path/to/sshd -ddde -p222 to run it on port 222), point your client
&lt;br&gt;at it and see what the reason given for the bind failure is.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 &amp;nbsp;37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;nbsp; &amp;nbsp; Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;usually comes from bad judgement.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26309288.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306247</id>
	<title>Re: [BUG?] sshd closes the connection after 2^16 bytes</title>
	<published>2009-11-11T05:31:29Z</published>
	<updated>2009-11-11T05:31:29Z</updated>
	<author>
		<name>Matthieu Moy-4</name>
	</author>
	<content type="html">Matthieu Moy &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306247&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Matthieu.Moy@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;br&gt;&amp;gt; Hmm, even funnier:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (head -c 196480 /dev/zero; sleep 0.25; head -c 196480 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;&amp;gt; 392960
&lt;br&gt;&amp;gt; (head -c 196480 /dev/zero; sleep 0.2; &amp;nbsp;head -c 196480 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;&amp;gt; 65536
&lt;br&gt;&lt;br&gt;Actually, just
&lt;br&gt;&lt;br&gt;(sleep 0.1; &amp;nbsp;head -c 196481 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;65536
&lt;br&gt;(sleep 0.2; &amp;nbsp;head -c 196481 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;196481
&lt;br&gt;&lt;br&gt;And interestingly, if I do
&lt;br&gt;&lt;br&gt;echo 'sleep 1' &amp;gt; ~/.bashrc
&lt;br&gt;&lt;br&gt;then
&lt;br&gt;&lt;br&gt;(sleep 1.0; &amp;nbsp;head -c 196481 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;65536
&lt;br&gt;(sleep 1.1; &amp;nbsp;head -c 196481 /dev/zero) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;196481
&lt;br&gt;&lt;br&gt;Also,
&lt;br&gt;&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1.2; echo boom) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;196485
&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1.0; echo boom) | ssh localhost &amp;quot;wc -c&amp;quot;
&lt;br&gt;65536
&lt;br&gt;&lt;br&gt;and,
&lt;br&gt;&lt;br&gt;ensibm:~&amp;gt;rm ~/.bashrc
&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1.0; echo boom) | ssh localhost &amp;quot;sleep 1; wc -c&amp;quot;
&lt;br&gt;65536
&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1.2; echo boom) | ssh localhost &amp;quot;sleep 1; wc -c&amp;quot;
&lt;br&gt;196485
&lt;br&gt;&lt;br&gt;and more precisely,
&lt;br&gt;&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1; echo boom) | ssh localhost &amp;quot;head -c 16383 | wc -c; sleep 2; wc -c&amp;quot;
&lt;br&gt;16383
&lt;br&gt;49153
&lt;br&gt;ensibm:~&amp;gt;(head -c 196480 /dev/zero; sleep 1; echo boom) | ssh localhost &amp;quot;head -c 16384 | wc -c; sleep 2; wc -c&amp;quot;
&lt;br&gt;16384
&lt;br&gt;180101
&lt;br&gt;&lt;br&gt;The last one says that if strictly more than 196480 bytes are sent to
&lt;br&gt;ssh, _and_ if strictly less than 16384 bytes (= 16KiB) are consumed
&lt;br&gt;quickly, then the bug occurs.
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;Matthieu Moy
&lt;br&gt;&lt;a href=&quot;http://www-verimag.imag.fr/~moy/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-verimag.imag.fr/~moy/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-BUG---sshd-closes-the-connection-after-2%5E16-bytes-tp26271500p26306247.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306188</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-11T05:10:49Z</published>
	<updated>2009-11-11T05:10:49Z</updated>
	<author>
		<name>Greg Wooledge</name>
	</author>
	<content type="html">On Tue, Nov 10, 2009 at 11:17:58PM +0100, Vincenzo Romano wrote:
&lt;br&gt;&amp;gt; ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306188&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&amp;gt; What happens instead is that, upon ssh connection on the remotehost I
&lt;br&gt;&amp;gt; see a listening socket on the interface 127.0.0.1!
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;-R [bind_address:]port:host:hostport
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;By default, the listening socket on the server will be bound to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the loopback interface only. &amp;nbsp;This may be overridden by specify-
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ing a bind_address. &amp;nbsp;An empty bind_address, or the address `*',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;indicates that the remote socket should listen on all interfaces.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Specifying a remote bind_address will only succeed if the serv-
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;er's GatewayPorts option is enabled (see sshd_config(5)).
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26306188.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306146</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-11T02:01:28Z</published>
	<updated>2009-11-11T02:01:28Z</updated>
	<author>
		<name>Vincenzo Romano</name>
	</author>
	<content type="html">It's not yet working though.
&lt;br&gt;&lt;br&gt;If I enable the GatewayPorts on the sshd_config (not ssh_config), then
&lt;br&gt;no RPF works anymore on the dummy interfaces or the loopback.
&lt;br&gt;They all fail with:
&lt;br&gt;Warning: remote port forwarding failed for listen port 139, despite
&lt;br&gt;there's no process listening on that interface and that port.
&lt;br&gt;&lt;br&gt;The client is:
&lt;br&gt;OpenSSH_4.4p1, OpenSSL 0.9.8d 28 Sep 2006
&lt;br&gt;The server is:
&lt;br&gt;OpenSSH_4.1p1, OpenSSL 0.9.7g 11 Apr 2005
&lt;br&gt;and I won't be able to update them.
&lt;br&gt;&lt;br&gt;What could be the next hint?
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;&lt;br&gt;2009/11/11 Darren Tucker &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306146&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dtucker@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Vincenzo Romano wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi all.
&lt;br&gt;&amp;gt;&amp;gt; I need to create a number of different reverse port forwarding (RPF)
&lt;br&gt;&amp;gt;&amp;gt; with the -R option.
&lt;br&gt;&amp;gt;&amp;gt; On the remote system I have set up a number of different dummy local
&lt;br&gt;&amp;gt;&amp;gt; interfaces (dummy0=127.0.1.1 to dummy9=127.0.1.10).
&lt;br&gt;&amp;gt;&amp;gt; A single RPF should look like this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306146&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; (it's actually for SAMBA printers reachability).
&lt;br&gt;&amp;gt;&amp;gt; What happens instead is that, upon ssh connection on the remotehost I
&lt;br&gt;&amp;gt;&amp;gt; see a listening socket on the interface 127.0.0.1!
&lt;br&gt;&amp;gt;&amp;gt; That's the lo (loopback) and not the dummy0.
&lt;br&gt;&amp;gt;&amp;gt; In an attempt to troubleshoot this problem I've changed the sshd
&lt;br&gt;&amp;gt;&amp;gt; configuration in order to have it listening on every single interface
&lt;br&gt;&amp;gt;&amp;gt; (as poosed to the default &amp;quot;one catches them all&amp;quot; setup). No luck.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you're using OpenSSH then you need to set &amp;quot;GatewayPorts clientspecified&amp;quot;
&lt;br&gt;&amp;gt; in sshd_config and restart sshd.  If your sshd doesn't understand
&lt;br&gt;&amp;gt; &amp;quot;clientspecified&amp;quot; then it also doesn't have the code to handle this case and
&lt;br&gt;&amp;gt; you'll need a newer version.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; quoth ssh_config(5):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;     GatewayPorts
&lt;br&gt;&amp;gt;             Specifies whether remote hosts are allowed to con-
&lt;br&gt;&amp;gt;             nect to ports forwarded for the client.  By
&lt;br&gt;&amp;gt;             default, sshd(8) binds remote port forwardings to
&lt;br&gt;&amp;gt;             the loopback address.  This prevents other remote
&lt;br&gt;&amp;gt;             hosts from connecting to forwarded ports.
&lt;br&gt;&amp;gt;             GatewayPorts can be used to specify that sshd
&lt;br&gt;&amp;gt;             should allow remote port forwardings to bind to
&lt;br&gt;&amp;gt;             non-loopback addresses, thus allowing other hosts
&lt;br&gt;&amp;gt;             to connect.  The argument may be &amp;quot;no&amp;quot; to force
&lt;br&gt;&amp;gt;             remote port forwardings to be available to the
&lt;br&gt;&amp;gt;             local host only, &amp;quot;yes&amp;quot; to force remote port for-
&lt;br&gt;&amp;gt;             wardings to bind to the wildcard address, or
&lt;br&gt;&amp;gt;             &amp;quot;clientspecified&amp;quot; to allow the client to select the
&lt;br&gt;&amp;gt;             address to which the forwarding is bound.  The
&lt;br&gt;&amp;gt;             default is &amp;quot;no&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;&amp;gt; GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;gt;    Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;&amp;gt; usually comes from bad judgement.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Vincenzo Romano
&lt;br&gt;NotOrAnd Information Technologies
&lt;br&gt;cel. +39 339 8083886 &amp;nbsp;| gtalk. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306146&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;vr@...&lt;/a&gt;
&lt;br&gt;fix. +39 0823 454163 &amp;nbsp;| skype. notorand.it
&lt;br&gt;fax. +39 02 700506964 | msn. &amp;nbsp; notorand.it
&lt;br&gt;--
&lt;br&gt;NON QVIETIS MARIBVS NAVTA PERITVS
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26306146.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306354</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-10T21:49:54Z</published>
	<updated>2009-11-10T21:49:54Z</updated>
	<author>
		<name>Vincenzo Romano</name>
	</author>
	<content type="html">Great!
&lt;br&gt;Isn't mine a FAQ?
&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;2009/11/11 Darren Tucker &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306354&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dtucker@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Vincenzo Romano wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi all.
&lt;br&gt;&amp;gt;&amp;gt; I need to create a number of different reverse port forwarding (RPF)
&lt;br&gt;&amp;gt;&amp;gt; with the -R option.
&lt;br&gt;&amp;gt;&amp;gt; On the remote system I have set up a number of different dummy local
&lt;br&gt;&amp;gt;&amp;gt; interfaces (dummy0=127.0.1.1 to dummy9=127.0.1.10).
&lt;br&gt;&amp;gt;&amp;gt; A single RPF should look like this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306354&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; (it's actually for SAMBA printers reachability).
&lt;br&gt;&amp;gt;&amp;gt; What happens instead is that, upon ssh connection on the remotehost I
&lt;br&gt;&amp;gt;&amp;gt; see a listening socket on the interface 127.0.0.1!
&lt;br&gt;&amp;gt;&amp;gt; That's the lo (loopback) and not the dummy0.
&lt;br&gt;&amp;gt;&amp;gt; In an attempt to troubleshoot this problem I've changed the sshd
&lt;br&gt;&amp;gt;&amp;gt; configuration in order to have it listening on every single interface
&lt;br&gt;&amp;gt;&amp;gt; (as poosed to the default &amp;quot;one catches them all&amp;quot; setup). No luck.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you're using OpenSSH then you need to set &amp;quot;GatewayPorts clientspecified&amp;quot;
&lt;br&gt;&amp;gt; in sshd_config and restart sshd.  If your sshd doesn't understand
&lt;br&gt;&amp;gt; &amp;quot;clientspecified&amp;quot; then it also doesn't have the code to handle this case and
&lt;br&gt;&amp;gt; you'll need a newer version.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; quoth ssh_config(5):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;     GatewayPorts
&lt;br&gt;&amp;gt;             Specifies whether remote hosts are allowed to con-
&lt;br&gt;&amp;gt;             nect to ports forwarded for the client.  By
&lt;br&gt;&amp;gt;             default, sshd(8) binds remote port forwardings to
&lt;br&gt;&amp;gt;             the loopback address.  This prevents other remote
&lt;br&gt;&amp;gt;             hosts from connecting to forwarded ports.
&lt;br&gt;&amp;gt;             GatewayPorts can be used to specify that sshd
&lt;br&gt;&amp;gt;             should allow remote port forwardings to bind to
&lt;br&gt;&amp;gt;             non-loopback addresses, thus allowing other hosts
&lt;br&gt;&amp;gt;             to connect.  The argument may be &amp;quot;no&amp;quot; to force
&lt;br&gt;&amp;gt;             remote port forwardings to be available to the
&lt;br&gt;&amp;gt;             local host only, &amp;quot;yes&amp;quot; to force remote port for-
&lt;br&gt;&amp;gt;             wardings to bind to the wildcard address, or
&lt;br&gt;&amp;gt;             &amp;quot;clientspecified&amp;quot; to allow the client to select the
&lt;br&gt;&amp;gt;             address to which the forwarding is bound.  The
&lt;br&gt;&amp;gt;             default is &amp;quot;no&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;&amp;gt; GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;gt;    Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;&amp;gt; usually comes from bad judgement.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Vincenzo Romano
&lt;br&gt;NotOrAnd Information Technologies
&lt;br&gt;cel. +39 339 8083886 &amp;nbsp;| gtalk. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306354&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;vr@...&lt;/a&gt;
&lt;br&gt;fix. +39 0823 454163 &amp;nbsp;| skype. notorand.it
&lt;br&gt;fax. +39 02 700506964 | msn. &amp;nbsp; notorand.it
&lt;br&gt;--
&lt;br&gt;NON QVIETIS MARIBVS NAVTA PERITVS
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26306354.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306109</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-10T20:40:57Z</published>
	<updated>2009-11-10T20:40:57Z</updated>
	<author>
		<name>Darren Tucker</name>
	</author>
	<content type="html">Vincenzo Romano wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all.
&lt;br&gt;&amp;gt; I need to create a number of different reverse port forwarding (RPF)
&lt;br&gt;&amp;gt; with the -R option.
&lt;br&gt;&amp;gt; On the remote system I have set up a number of different dummy local
&lt;br&gt;&amp;gt; interfaces (dummy0=127.0.1.1 to dummy9=127.0.1.10).
&lt;br&gt;&amp;gt; A single RPF should look like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306109&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (it's actually for SAMBA printers reachability).
&lt;br&gt;&amp;gt; What happens instead is that, upon ssh connection on the remotehost I
&lt;br&gt;&amp;gt; see a listening socket on the interface 127.0.0.1!
&lt;br&gt;&amp;gt; That's the lo (loopback) and not the dummy0.
&lt;br&gt;&amp;gt; In an attempt to troubleshoot this problem I've changed the sshd
&lt;br&gt;&amp;gt; configuration in order to have it listening on every single interface
&lt;br&gt;&amp;gt; (as poosed to the default &amp;quot;one catches them all&amp;quot; setup). No luck.
&lt;/div&gt;&lt;br&gt;If you're using OpenSSH then you need to set &amp;quot;GatewayPorts 
&lt;br&gt;clientspecified&amp;quot; in sshd_config and restart sshd. &amp;nbsp;If your sshd doesn't 
&lt;br&gt;understand &amp;quot;clientspecified&amp;quot; then it also doesn't have the code to 
&lt;br&gt;handle this case and you'll need a newer version.
&lt;br&gt;&lt;br&gt;quoth ssh_config(5):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; GatewayPorts
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Specifies whether remote hosts are allowed to con-
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nect to ports forwarded for the client. &amp;nbsp;By
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default, sshd(8) binds remote port forwardings to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the loopback address. &amp;nbsp;This prevents other remote
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hosts from connecting to forwarded ports.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GatewayPorts can be used to specify that sshd
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; should allow remote port forwardings to bind to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; non-loopback addresses, thus allowing other hosts
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to connect. &amp;nbsp;The argument may be &amp;quot;no&amp;quot; to force
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; remote port forwardings to be available to the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; local host only, &amp;quot;yes&amp;quot; to force remote port for-
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wardings to bind to the wildcard address, or
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;clientspecified&amp;quot; to allow the client to select the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; address to which the forwarding is bound. &amp;nbsp;The
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default is &amp;quot;no&amp;quot;.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 &amp;nbsp;37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;usually comes from bad judgement.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26306109.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26306074</id>
	<title>Re: Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-10T19:38:02Z</published>
	<updated>2009-11-10T19:38:02Z</updated>
	<author>
		<name>Joseph Spenner</name>
	</author>
	<content type="html">&lt;br&gt;--- On Tue, 11/10/09, Vincenzo Romano &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306074&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Vincenzo.Romano@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On the remote system I have set up a number of different
&lt;br&gt;&amp;gt; dummy local
&lt;br&gt;&amp;gt; interfaces (dummy0=127.0.1.1 to dummy9=127.0.1.10).
&lt;br&gt;&amp;gt; A single RPF should look like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26306074&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (it's actually for SAMBA printers reachability).
&lt;br&gt;&amp;gt; What happens instead is that, upon ssh connection on the
&lt;br&gt;&amp;gt; remotehost I
&lt;br&gt;&amp;gt; see a listening socket on the interface 127.0.0.1!
&lt;/div&gt;&lt;br&gt;I'm not very clear on what your goal is, but anything beginning with 127 (127.x.y.z) is going to be treated the same-- localhost. &amp;nbsp;You can address all 16 million possibilities any way you want, but they all will appear the same localhost to the system.
&lt;br&gt;&lt;br&gt;What is your specific goal?
&lt;br&gt;&lt;br&gt;Also, your -R needs 1 argument: &amp;nbsp;RemotePort:Ip-relative-to-Target:Port-on-relative-Target IP-of-Target
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26306074.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26293500</id>
	<title>Reverse port forwarding (-R) seems not working</title>
	<published>2009-11-10T14:17:58Z</published>
	<updated>2009-11-10T14:17:58Z</updated>
	<author>
		<name>Vincenzo Romano</name>
	</author>
	<content type="html">Hi all.
&lt;br&gt;I need to create a number of different reverse port forwarding (RPF)
&lt;br&gt;with the -R option.
&lt;br&gt;On the remote system I have set up a number of different dummy local
&lt;br&gt;interfaces (dummy0=127.0.1.1 to dummy9=127.0.1.10).
&lt;br&gt;A single RPF should look like this:
&lt;br&gt;&lt;br&gt;ssh -N -n -R 127.0.1.1:139:somelocalhost:139 &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26293500&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;(it's actually for SAMBA printers reachability).
&lt;br&gt;What happens instead is that, upon ssh connection on the remotehost I
&lt;br&gt;see a listening socket on the interface 127.0.0.1!
&lt;br&gt;That's the lo (loopback) and not the dummy0.
&lt;br&gt;In an attempt to troubleshoot this problem I've changed the sshd
&lt;br&gt;configuration in order to have it listening on every single interface
&lt;br&gt;(as poosed to the default &amp;quot;one catches them all&amp;quot; setup). No luck.
&lt;br&gt;&lt;br&gt;Now I see two options:
&lt;br&gt;either I'm missing something important
&lt;br&gt;or this is a bug.
&lt;br&gt;&lt;br&gt;I hope for the first option so I can hope in a simple solution.
&lt;br&gt;&lt;br&gt;Any hint on this?
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;Vincenzo Romano
&lt;br&gt;NON QVIETIS MARIBVS NAVTA PERITVS
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Reverse-port-forwarding-%28-R%29-seems-not-working-tp26293500p26293500.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26288051</id>
	<title>Re: [BUG?] sshd closes the connection after 2^16 bytes</title>
	<published>2009-11-09T23:13:16Z</published>
	<updated>2009-11-09T23:13:16Z</updated>
	<author>
		<name>Matthieu Moy-4</name>
	</author>
	<content type="html">Lamont Granquist &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26288051&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lamont@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;br&gt;&amp;gt; i can't replicate that, but what does this return for you:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; head -c 196481 /dev/zero | cat -u | ssh machine-name 'LANG=C wc'
&lt;br&gt;&lt;br&gt;head -c 196481 /dev/zero | cat -u | ssh localhost 'LANG=C wc'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Matthieu Moy
&lt;br&gt;&lt;a href=&quot;http://www-verimag.imag.fr/~moy/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-verimag.imag.fr/~moy/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-BUG---sshd-closes-the-connection-after-2%5E16-bytes-tp26271500p26288051.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26276459</id>
	<title>Re: [BUG?] sshd closes the connection after 2^16 bytes</title>
	<published>2009-11-09T14:15:05Z</published>
	<updated>2009-11-09T14:15:05Z</updated>
	<author>
		<name>Lamont Granquist</name>
	</author>
	<content type="html">&lt;br&gt;i can't replicate that, but what does this return for you:
&lt;br&gt;&lt;br&gt;head -c 196481 /dev/zero | cat -u | ssh machine-name 'LANG=C wc'
&lt;br&gt;&lt;br&gt;On Mon, 9 Nov 2009, Matthieu Moy wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm having trouble with the sshd on one particular machine. In short:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (the 65536 here should have been a 196481 ...)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This happens whether I launch the command from the machine, or from
&lt;br&gt;&amp;gt; another remote machine. The OpenSSH version is:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; with:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ cat /etc/redhat-release
&lt;br&gt;&amp;gt; Red Hat Enterprise Linux Server release 5.4 (Tikanga)
&lt;br&gt;&amp;gt; $ uname -a
&lt;br&gt;&amp;gt; Linux machine-name 2.6.18-128.7.1.el5 #1 SMP Wed Aug 19 04:08:13 EDT 2009 ppc64 ppc64 ppc64 GNU/Linux
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One surprising thing:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&amp;gt; $ head -c 196480 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp;196480
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, the bug is triggered when sending 196481 bytes or more, but the
&lt;br&gt;&amp;gt; consequence is a truncation of the input at 65536=2^16 bytes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any idea what's going on?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; Matthieu Moy
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www-verimag.imag.fr/~moy/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-verimag.imag.fr/~moy/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-BUG---sshd-closes-the-connection-after-2%5E16-bytes-tp26271500p26276459.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26271500</id>
	<title>[BUG?] sshd closes the connection after 2^16 bytes</title>
	<published>2009-11-09T06:26:23Z</published>
	<updated>2009-11-09T06:26:23Z</updated>
	<author>
		<name>Matthieu Moy-4</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I'm having trouble with the sshd on one particular machine. In short:
&lt;br&gt;&lt;br&gt;$ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;&lt;br&gt;(the 65536 here should have been a 196481 ...)
&lt;br&gt;&lt;br&gt;This happens whether I launch the command from the machine, or from
&lt;br&gt;another remote machine. The OpenSSH version is:
&lt;br&gt;&lt;br&gt;OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
&lt;br&gt;&lt;br&gt;with:
&lt;br&gt;&lt;br&gt;$ cat /etc/redhat-release 
&lt;br&gt;Red Hat Enterprise Linux Server release 5.4 (Tikanga)
&lt;br&gt;$ uname -a
&lt;br&gt;Linux machine-name 2.6.18-128.7.1.el5 #1 SMP Wed Aug 19 04:08:13 EDT 2009 ppc64 ppc64 ppc64 GNU/Linux
&lt;br&gt;&lt;br&gt;One surprising thing:
&lt;br&gt;&lt;br&gt;$ head -c 196481 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 65536
&lt;br&gt;$ head -c 196480 /dev/zero | ssh machine-name 'LANG=C wc'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp;196480
&lt;br&gt;&lt;br&gt;So, the bug is triggered when sending 196481 bytes or more, but the
&lt;br&gt;consequence is a truncation of the input at 65536=2^16 bytes.
&lt;br&gt;&lt;br&gt;Any idea what's going on?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Matthieu Moy
&lt;br&gt;&lt;a href=&quot;http://www-verimag.imag.fr/~moy/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-verimag.imag.fr/~moy/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-BUG---sshd-closes-the-connection-after-2%5E16-bytes-tp26271500p26271500.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26167588</id>
	<title>ssh tools and SSH_ASKPASS</title>
	<published>2009-11-02T06:50:02Z</published>
	<updated>2009-11-02T06:50:02Z</updated>
	<author>
		<name>Ciprian Dorin, Craciun</name>
	</author>
	<content type="html">&amp;nbsp; &amp;nbsp; Hello all!
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; I've played this weekend with the SSH_ASKPASS feature of ssh-add
&lt;br&gt;and ssh tools, and I must say that I like the idea, because it allows
&lt;br&gt;me to input the passwords for either a key or authentication from a
&lt;br&gt;(more) secure terminal. (For example if I don't trust my applications
&lt;br&gt;running in the same X session, I can use a custom SSH_ASKPASS to query
&lt;br&gt;the password from /dev/tty11, which I did.)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; But now there is a problem... You really have to try hard to
&lt;br&gt;convince ssh-add and ssh tools to use the SSH_ASKPASS feature, by
&lt;br&gt;resorting to the following tricks:
&lt;br&gt;&amp;nbsp; &amp;nbsp; * ssh-add ... &amp;lt;/dev/null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; * notty ssh -t ...; (where notty is a custom application that
&lt;br&gt;detaches the application from the controlling terminal);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; So my question is: woldn't it be nice to have all the tools always
&lt;br&gt;obey the SSH_ASKPASS setting?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Thanks,
&lt;br&gt;&amp;nbsp; &amp;nbsp; Ciprian Craciun.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-tools-and-SSH_ASKPASS-tp26167588p26167588.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26080236</id>
	<title>Re: Setting permissions of ssh access</title>
	<published>2009-10-26T15:40:15Z</published>
	<updated>2009-10-26T15:40:15Z</updated>
	<author>
		<name>Lists</name>
	</author>
	<content type="html">Yes, my main goal is to use rsync-backup once I have a good test case &amp;nbsp;
&lt;br&gt;going. &amp;nbsp;I spent a lot of time on OS X getting two machines to talk to &amp;nbsp;
&lt;br&gt;each other with passwordless logins and using a root account. &amp;nbsp;I was &amp;nbsp;
&lt;br&gt;pulling the backup from the client, to the server.
&lt;br&gt;&lt;br&gt;I went by this article, which expressly states that push backups are &amp;nbsp;
&lt;br&gt;not the way to go:
&lt;br&gt;&lt;a href=&quot;http://www.connect.homeunix.com/lbackup/network_backup_strategies&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.connect.homeunix.com/lbackup/network_backup_strategies&lt;/a&gt;&lt;br&gt;&lt;br&gt;It struck me as odd as well, and I am going to go back to pushing the &amp;nbsp;
&lt;br&gt;data from the machines out to the single backup machine, which I can &amp;nbsp;
&lt;br&gt;section off to not even be accessible to the outside world.
&lt;br&gt;&lt;br&gt;As I go through this process, I will document it, as there were some &amp;nbsp;
&lt;br&gt;pretty strange thins happening with sshd_conf and not letting me have &amp;nbsp;
&lt;br&gt;a root login.
&lt;br&gt;&lt;br&gt;Thanks for your comments, as soon as I have more, I will follow up.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Scott * If you contact me off list replace talklists@ with scott@ *
&lt;br&gt;&lt;br&gt;On Oct 26, 2009, at 11:04 AM, Quintin Beukes wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Rather PUSH backups. This way you can
&lt;br&gt;&amp;gt; 1) Close the backup machine to allow ONLY access from the specified
&lt;br&gt;&amp;gt; machines on an IP/MAC bases (since it's local net)
&lt;br&gt;&amp;gt; 2) You don't have to open up root access for any machines
&lt;br&gt;&amp;gt; 3) You can have the rsync client run as root to allow it to copy all
&lt;br&gt;&amp;gt; files on it's own machine, then copying it to a lower access user on
&lt;br&gt;&amp;gt; the target machine.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you want your backup files to be stored with the same
&lt;br&gt;&amp;gt; ownership/permissions as on the source machine, you would have to
&lt;br&gt;&amp;gt; login as root on the backup machine. If it's closed from outside
&lt;br&gt;&amp;gt; access this is safer than allowing root access to your public machine.
&lt;br&gt;&amp;gt; Further restricting it by IP/MAC makes this even more secure.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If using something like rsync-backup, you're basically running a
&lt;br&gt;&amp;gt; static command on the backup server's side, which provides an extra
&lt;br&gt;&amp;gt; level of security if you want to have the backup server side execute
&lt;br&gt;&amp;gt; as root as well. Let me explain it like this:
&lt;br&gt;&amp;gt; 1) You have the source machine S - it's public
&lt;br&gt;&amp;gt; 2) You have the machine machine B - it's completely closed up and only
&lt;br&gt;&amp;gt; allows IP/MAC level filtering on incoming port 22 from machine S
&lt;br&gt;&amp;gt; 3) On machine B you have a root account with a password for you to &amp;nbsp;
&lt;br&gt;&amp;gt; login
&lt;br&gt;&amp;gt; 4) You want machine S to use this root account to copy it's backups
&lt;br&gt;&amp;gt; 5) You use rsync-backup wrapped in ssh to do this. This means you have
&lt;br&gt;&amp;gt; 2 commands run by ssh, the rsync-backup client command and
&lt;br&gt;&amp;gt; rsync-backup server side command
&lt;br&gt;&amp;gt; 6) You setup a public key on the root account on machine B, which is
&lt;br&gt;&amp;gt; only allowed to run a single command, the rsync-backup command. This
&lt;br&gt;&amp;gt; means rsync-backup authenticates using the public key, but is only
&lt;br&gt;&amp;gt; allowed to run a fixed command, which is the one it uses to copy the
&lt;br&gt;&amp;gt; backups. So it is authenticated as root, which allows you to copy all
&lt;br&gt;&amp;gt; types of ownership/permissions, even setuid bits, but you can't do ANY
&lt;br&gt;&amp;gt; other than what rsync-backup command and it's protocol allows.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Have you heard of rsync-backup? It's a utility which uses rsync's
&lt;br&gt;&amp;gt; libraries, but provides common backup features like exclusions,
&lt;br&gt;&amp;gt; incremental backups + increment management, etc. The technique listed
&lt;br&gt;&amp;gt; above is what I use to make all my backups. It's really simple, works
&lt;br&gt;&amp;gt; brilliantly and with the specified would be very secure as well. Since
&lt;br&gt;&amp;gt; it's running as root there is always the risk of exploitation to gain
&lt;br&gt;&amp;gt; root access, which could cause compromise of your other machines,
&lt;br&gt;&amp;gt; though it's already very secure and always possible to add extra
&lt;br&gt;&amp;gt; levels of security.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Quintin Beukes
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Oct 23, 2009 at 9:28 PM, Scott Haneda &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26080236&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;talklists@...&lt;/a&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hello, I've looked around and found a few different approaches to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; this.
&lt;br&gt;&amp;gt;&amp;gt; Looking for a discussion of the pros, cons, and best practices.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I want to use rsync over an ssh connection to clone one machine to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; another.
&lt;br&gt;&amp;gt;&amp;gt; This means one end will need root login.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Right now I have passwordless keys to allow myself to login. Root &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; login is
&lt;br&gt;&amp;gt;&amp;gt; disabled.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Would an acceptable method be to allow root login from a specific IP
&lt;br&gt;&amp;gt;&amp;gt; address? Or is there some other way to allow root privilege use &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; between a
&lt;br&gt;&amp;gt;&amp;gt; source and destination host without opening it up by IP?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This is for backups, and only ever will be machine to machine, same &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; subnet.
&lt;br&gt;&amp;gt;&amp;gt; I'm not immediately seeing how to set granular permissions based on
&lt;br&gt;&amp;gt;&amp;gt; conditions like IP, MAC, or other harder to spoof credentials.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I'd it better to pull backups or push backups, or equivalent?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The backup machine could be made to have no public access at all. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Thanks for
&lt;br&gt;&amp;gt;&amp;gt; any pointers.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; Scott
&lt;br&gt;&amp;gt;&amp;gt; Iphone says hello.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Setting-permissions-of-ssh-access-tp26053948p26080236.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26066374</id>
	<title>Re: Setting permissions of ssh access</title>
	<published>2009-10-26T11:04:03Z</published>
	<updated>2009-10-26T11:04:03Z</updated>
	<author>
		<name>Quintin Beukes-2</name>
	</author>
	<content type="html">Rather PUSH backups. This way you can
&lt;br&gt;1) Close the backup machine to allow ONLY access from the specified
&lt;br&gt;machines on an IP/MAC bases (since it's local net)
&lt;br&gt;2) You don't have to open up root access for any machines
&lt;br&gt;3) You can have the rsync client run as root to allow it to copy all
&lt;br&gt;files on it's own machine, then copying it to a lower access user on
&lt;br&gt;the target machine.
&lt;br&gt;&lt;br&gt;If you want your backup files to be stored with the same
&lt;br&gt;ownership/permissions as on the source machine, you would have to
&lt;br&gt;login as root on the backup machine. If it's closed from outside
&lt;br&gt;access this is safer than allowing root access to your public machine.
&lt;br&gt;Further restricting it by IP/MAC makes this even more secure.
&lt;br&gt;&lt;br&gt;If using something like rsync-backup, you're basically running a
&lt;br&gt;static command on the backup server's side, which provides an extra
&lt;br&gt;level of security if you want to have the backup server side execute
&lt;br&gt;as root as well. Let me explain it like this:
&lt;br&gt;1) You have the source machine S - it's public
&lt;br&gt;2) You have the machine machine B - it's completely closed up and only
&lt;br&gt;allows IP/MAC level filtering on incoming port 22 from machine S
&lt;br&gt;3) On machine B you have a root account with a password for you to login
&lt;br&gt;4) You want machine S to use this root account to copy it's backups
&lt;br&gt;5) You use rsync-backup wrapped in ssh to do this. This means you have
&lt;br&gt;2 commands run by ssh, the rsync-backup client command and
&lt;br&gt;rsync-backup server side command
&lt;br&gt;6) You setup a public key on the root account on machine B, which is
&lt;br&gt;only allowed to run a single command, the rsync-backup command. This
&lt;br&gt;means rsync-backup authenticates using the public key, but is only
&lt;br&gt;allowed to run a fixed command, which is the one it uses to copy the
&lt;br&gt;backups. So it is authenticated as root, which allows you to copy all
&lt;br&gt;types of ownership/permissions, even setuid bits, but you can't do ANY
&lt;br&gt;other than what rsync-backup command and it's protocol allows.
&lt;br&gt;&lt;br&gt;Have you heard of rsync-backup? It's a utility which uses rsync's
&lt;br&gt;libraries, but provides common backup features like exclusions,
&lt;br&gt;incremental backups + increment management, etc. The technique listed
&lt;br&gt;above is what I use to make all my backups. It's really simple, works
&lt;br&gt;brilliantly and with the specified would be very secure as well. Since
&lt;br&gt;it's running as root there is always the risk of exploitation to gain
&lt;br&gt;root access, which could cause compromise of your other machines,
&lt;br&gt;though it's already very secure and always possible to add extra
&lt;br&gt;levels of security.
&lt;br&gt;&lt;br&gt;Quintin Beukes
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Fri, Oct 23, 2009 at 9:28 PM, Scott Haneda &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26066374&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;talklists@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello, I've looked around and found a few different approaches to this.
&lt;br&gt;&amp;gt; Looking for a discussion of the pros, cons, and best practices.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I want to use rsync over an ssh connection to clone one machine to another.
&lt;br&gt;&amp;gt; This means one end will need root login.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Right now I have passwordless keys to allow myself to login. Root login is
&lt;br&gt;&amp;gt; disabled.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would an acceptable method be to allow root login from a specific IP
&lt;br&gt;&amp;gt; address? Or is there some other way to allow root privilege use between a
&lt;br&gt;&amp;gt; source and destination host without opening it up by IP?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is for backups, and only ever will be machine to machine, same subnet.
&lt;br&gt;&amp;gt; I'm not immediately seeing how to set granular permissions based on
&lt;br&gt;&amp;gt; conditions like IP, MAC, or other harder to spoof credentials.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'd it better to pull backups or push backups, or equivalent?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The backup machine could be made to have no public access at all. Thanks for
&lt;br&gt;&amp;gt; any pointers.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Scott
&lt;br&gt;&amp;gt; Iphone says hello.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Setting-permissions-of-ssh-access-tp26053948p26066374.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26053925</id>
	<title>alternate output for progressmeter</title>
	<published>2009-10-24T14:34:41Z</published>
	<updated>2009-10-24T14:34:41Z</updated>
	<author>
		<name>Hans Harder</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I used scp in some background process for transferring large files
&lt;br&gt;which took some hours.
&lt;br&gt;For this I needed a less fancy output, preferable parseble by a script
&lt;br&gt;, so I could regularly see how far the transfer was
&lt;br&gt;&lt;br&gt;The adaptions I made to progressmeter.c and .h are underneath my mail as a patch
&lt;br&gt;&lt;br&gt;Some sample output how it looks now:
&lt;br&gt;:~/src/openssh-5.3p1$ ./scp -l 60000 test.bin hans@localhost:.
&lt;br&gt;progress test.bin : &amp;nbsp; 0% &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0.0KB/s &amp;nbsp; --:-- ETA
&lt;br&gt;progress test.bin : &amp;nbsp; 7% 7488KB &amp;nbsp; 7.3MB/s &amp;nbsp; 00:12 ETA
&lt;br&gt;progress test.bin : &amp;nbsp;15% &amp;nbsp; 14MB &amp;nbsp; 7.3MB/s &amp;nbsp; 00:11 ETA
&lt;br&gt;..
&lt;br&gt;progress test.bin : &amp;nbsp;98% &amp;nbsp; 94MB &amp;nbsp; 7.3MB/s &amp;nbsp; 00:00 ETA
&lt;br&gt;progress test.bin : 100% &amp;nbsp; 95MB &amp;nbsp; 7.3MB/s &amp;nbsp; 00:13 done
&lt;br&gt;&lt;br&gt;With a simple script you can now easily control the output and save
&lt;br&gt;the progress somewhere:
&lt;br&gt;&lt;br&gt;#!/bin/bash
&lt;br&gt;# --- only update status every 10 seconds
&lt;br&gt;statfn=scp1.status
&lt;br&gt;refresh=10
&lt;br&gt;no=0
&lt;br&gt;./scp -l 60000 test.bin hans@localhost:. 2&amp;gt;&amp;1|while read id fn sep
&lt;br&gt;perc size speed estim eta
&lt;br&gt;do
&lt;br&gt;&amp;nbsp; ((state=no % refresh))
&lt;br&gt;&amp;nbsp; [[ &amp;quot;$eta&amp;quot; = &amp;quot;done&amp;quot; || $state -eq 0 ]] &amp;&amp; echo &amp;quot;`date +&amp;quot;%Y-%m-%d
&lt;br&gt;%H:%M:%S&amp;quot;` $fn $perc $size $speed $estim $eta&amp;quot; &amp;gt;$statfn
&lt;br&gt;&amp;nbsp; ((no=no+1))
&lt;br&gt;done
&lt;br&gt;&lt;br&gt;The patch only adds this functionality as an option, default the
&lt;br&gt;original layout is used.
&lt;br&gt;Only when variable progresstype is set to nonzero this alternate
&lt;br&gt;output is selected.
&lt;br&gt;For selecting the alternate output it would only require some
&lt;br&gt;commandline option in scp.c and do the isatty check only when
&lt;br&gt;progresstype==0
&lt;br&gt;&lt;br&gt;Let me know your comments...
&lt;br&gt;&lt;br&gt;Hans
&lt;br&gt;&lt;br&gt;--- progressmeter.h	2006-03-26 05:30:02.000000000 +0200
&lt;br&gt;+++ progressmeter_new.h	2009-10-24 20:35:35.168288539 +0200
&lt;br&gt;@@ -23,5 +23,7 @@
&lt;br&gt;&amp;nbsp; * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
&lt;br&gt;&amp;nbsp; */
&lt;br&gt;&lt;br&gt;+extern	int	progresstype;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;void	start_progress_meter(char *, off_t, off_t *);
&lt;br&gt;&amp;nbsp;void	stop_progress_meter(void);
&lt;br&gt;&lt;br&gt;&lt;br&gt;--- progressmeter.c	2006-08-05 04:39:40.000000000 +0200
&lt;br&gt;+++ progressmeter_new.c	2009-10-24 20:32:45.455788330 +0200
&lt;br&gt;@@ -74,12 +74,15 @@
&lt;br&gt;&amp;nbsp;static int win_size;		/* terminal window size */
&lt;br&gt;&amp;nbsp;static volatile sig_atomic_t win_resized; /* for window resizing */
&lt;br&gt;&lt;br&gt;+int	progresstype = 0;	/* use default tty progress reporting */
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;/* units for format_size */
&lt;br&gt;&amp;nbsp;static const char unit[] = &amp;quot; KMGT&amp;quot;;
&lt;br&gt;&lt;br&gt;&amp;nbsp;static int
&lt;br&gt;&amp;nbsp;can_output(void)
&lt;br&gt;&amp;nbsp;{
&lt;br&gt;+	if (progresstype) return 1;
&lt;br&gt;&amp;nbsp;	return (getpgrp() == tcgetpgrp(STDOUT_FILENO));
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;@@ -158,9 +161,9 @@
&lt;br&gt;&lt;br&gt;&amp;nbsp;	/* filename */
&lt;br&gt;&amp;nbsp;	buf[0] = '\0';
&lt;br&gt;-	file_len = win_size - 35;
&lt;br&gt;+	file_len = (progresstype)?(strlen(file)+11):(win_size - 35);
&lt;br&gt;&amp;nbsp;	if (file_len &amp;gt; 0) {
&lt;br&gt;-		len = snprintf(buf, file_len + 1, &amp;quot;\r%s&amp;quot;, file);
&lt;br&gt;+		len = snprintf(buf, file_len + 1, (progresstype)?&amp;quot;progress %s
&lt;br&gt;:&amp;quot;:&amp;quot;\r%s&amp;quot;, file);
&lt;br&gt;&amp;nbsp;		if (len &amp;lt; 0)
&lt;br&gt;&amp;nbsp;			len = 0;
&lt;br&gt;&amp;nbsp;		if (len &amp;gt;= file_len + 1)
&lt;br&gt;@@ -195,7 +198,7 @@
&lt;br&gt;&amp;nbsp;		stalled = 0;
&lt;br&gt;&lt;br&gt;&amp;nbsp;	if (stalled &amp;gt;= STALL_TIME)
&lt;br&gt;-		strlcat(buf, &amp;quot;- stalled -&amp;quot;, win_size);
&lt;br&gt;+		strlcat(buf, (progresstype)?&amp;quot;-stalled-&amp;quot;:&amp;quot;- stalled -&amp;quot;, win_size);
&lt;br&gt;&amp;nbsp;	else if (bytes_per_second == 0 &amp;&amp; bytes_left)
&lt;br&gt;&amp;nbsp;		strlcat(buf, &amp;quot; &amp;nbsp;--:-- ETA&amp;quot;, win_size);
&lt;br&gt;&amp;nbsp;	else {
&lt;br&gt;@@ -219,10 +222,14 @@
&lt;br&gt;&amp;nbsp;		if (bytes_left &amp;gt; 0)
&lt;br&gt;&amp;nbsp;			strlcat(buf, &amp;quot; ETA&amp;quot;, win_size);
&lt;br&gt;&amp;nbsp;		else
&lt;br&gt;-			strlcat(buf, &amp;quot; &amp;nbsp; &amp;nbsp;&amp;quot;, win_size);
&lt;br&gt;+			strlcat(buf, (progresstype)?&amp;quot; done&amp;quot;:&amp;quot; &amp;nbsp; &amp;nbsp;&amp;quot;, win_size);
&lt;br&gt;&amp;nbsp;	}
&lt;br&gt;&lt;br&gt;-	atomicio(vwrite, STDOUT_FILENO, buf, win_size - 1);
&lt;br&gt;+	if (progresstype) {
&lt;br&gt;+		strlcat(buf,&amp;quot;\n&amp;quot;,win_size);
&lt;br&gt;+		atomicio(vwrite, STDOUT_FILENO, buf, strlen(buf));
&lt;br&gt;+	} else
&lt;br&gt;+		atomicio(vwrite, STDOUT_FILENO, buf, win_size - 1);
&lt;br&gt;&amp;nbsp;	last_update = now;
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;@@ -234,7 +241,7 @@
&lt;br&gt;&lt;br&gt;&amp;nbsp;	save_errno = errno;
&lt;br&gt;&lt;br&gt;-	if (win_resized) {
&lt;br&gt;+	if (progresstype==0 &amp;&amp; win_resized) {
&lt;br&gt;&amp;nbsp;		setscreensize();
&lt;br&gt;&amp;nbsp;		win_resized = 0;
&lt;br&gt;&amp;nbsp;	}
&lt;br&gt;@@ -257,12 +264,16 @@
&lt;br&gt;&amp;nbsp;	stalled = 0;
&lt;br&gt;&amp;nbsp;	bytes_per_second = 0;
&lt;br&gt;&lt;br&gt;-	setscreensize();
&lt;br&gt;+	if (progresstype)
&lt;br&gt;+		win_size=MAX_WINSIZE;
&lt;br&gt;+	else {
&lt;br&gt;+		setscreensize();
&lt;br&gt;+		signal(SIGWINCH, sig_winch);
&lt;br&gt;+	}
&lt;br&gt;&amp;nbsp;	if (can_output())
&lt;br&gt;&amp;nbsp;		refresh_progress_meter();
&lt;br&gt;&lt;br&gt;&amp;nbsp;	signal(SIGALRM, update_progress_meter);
&lt;br&gt;-	signal(SIGWINCH, sig_winch);
&lt;br&gt;&amp;nbsp;	alarm(UPDATE_INTERVAL);
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;@@ -278,7 +289,8 @@
&lt;br&gt;&amp;nbsp;	if (cur_pos != end_pos)
&lt;br&gt;&amp;nbsp;		refresh_progress_meter();
&lt;br&gt;&lt;br&gt;-	atomicio(vwrite, STDOUT_FILENO, &amp;quot;\n&amp;quot;, 1);
&lt;br&gt;+	if (progresstype==0)
&lt;br&gt;+		atomicio(vwrite, STDOUT_FILENO, &amp;quot;\n&amp;quot;, 1);
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp;/*ARGSUSED*/
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/alternate-output-for-progressmeter-tp26053925p26053925.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26053948</id>
	<title>Setting permissions of ssh access</title>
	<published>2009-10-23T12:28:57Z</published>
	<updated>2009-10-23T12:28:57Z</updated>
	<author>
		<name>Lists</name>
	</author>
	<content type="html">Hello, I've looked around and found a few different approaches to &amp;nbsp;
&lt;br&gt;this. Looking for a discussion of the pros, cons, and best practices.
&lt;br&gt;&lt;br&gt;I want to use rsync over an ssh connection to clone one machine to &amp;nbsp;
&lt;br&gt;another. This means one end will need root login.
&lt;br&gt;&lt;br&gt;Right now I have passwordless keys to allow myself to login. Root &amp;nbsp;
&lt;br&gt;login is disabled.
&lt;br&gt;&lt;br&gt;Would an acceptable method be to allow root login from a specific IP &amp;nbsp;
&lt;br&gt;address? Or is there some other way to allow root privilege use &amp;nbsp;
&lt;br&gt;between a source and destination host without opening it up by IP?
&lt;br&gt;&lt;br&gt;This is for backups, and only ever will be machine to machine, same &amp;nbsp;
&lt;br&gt;subnet. I'm not immediately seeing how to set granular permissions &amp;nbsp;
&lt;br&gt;based on conditions like IP, MAC, or other harder to spoof credentials.
&lt;br&gt;&lt;br&gt;I'd it better to pull backups or push backups, or equivalent?
&lt;br&gt;&lt;br&gt;The backup machine could be made to have no public access at all. &amp;nbsp;
&lt;br&gt;Thanks for any pointers.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Scott
&lt;br&gt;Iphone says hello.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Setting-permissions-of-ssh-access-tp26053948p26053948.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25995611</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-10-21T02:31:24Z</published>
	<updated>2009-10-21T02:31:24Z</updated>
	<author>
		<name>Quintin Beukes-2</name>
	</author>
	<content type="html">On Tue, Oct 20, 2009 at 7:03 PM, Quintin Beukes &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25995611&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;quintin@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Hey,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How do you close the console? And, can you share the command with the
&lt;br&gt;&amp;gt; list please.
&lt;br&gt;&lt;br&gt;The reason I'm asking this is that the fact it is a bind: address
&lt;br&gt;already in use error, means the bind() call failed. So according to
&lt;br&gt;the networking stack that port is still bound. A netstat command on
&lt;br&gt;the remote server should definitely show this. The commands Greg
&lt;br&gt;listed (the lsof -i :1026 and netstat -antp) will give you this
&lt;br&gt;information.
&lt;br&gt;&lt;br&gt;Remember to run the 2 commands as root (lsof needs to be root, and for
&lt;br&gt;netstat's -p to work as well).
&lt;br&gt;&lt;br&gt;Further, you can also try: netstat -antpl | grep :1026
&lt;br&gt;This will filter into only showing matching listening ports. I often
&lt;br&gt;do this because it's so easy to miss it among all those ports.
&lt;br&gt;&lt;br&gt;Q
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25995611.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25995583</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-10-20T23:16:19Z</published>
	<updated>2009-10-20T23:16:19Z</updated>
	<author>
		<name>Adrya-2</name>
	</author>
	<content type="html">Thank you all for your replies :)
&lt;br&gt;&lt;br&gt;This is the command i use: ssh -L 30300:localhost:8080 -R
&lt;br&gt;1026:localhost:55555 &amp;nbsp;-F ssh_config -N &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25995583&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ipp@...&lt;/a&gt;
&lt;br&gt;And i close the ssh process by closing the windows console, or by
&lt;br&gt;killing the ssh process from another application. Either way when i
&lt;br&gt;look in processes list after closing ssh process is gone when i try to
&lt;br&gt;reconnect again.
&lt;br&gt;&lt;br&gt;I guess that's the explanation suggested above why sometimes it
&lt;br&gt;doesn't allow me to reconnect with same port, TCP connection staying
&lt;br&gt;in a wait state even after previous ssh client process terminates and
&lt;br&gt;it keeps that remote port busy.
&lt;br&gt;Maybe that's why it didn't showed with &amp;quot;netstat -an&amp;quot; command.
&lt;br&gt;Next time i will use the other commands suggested :)
&lt;br&gt;&lt;br&gt;Thank you again,
&lt;br&gt;Adriana
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25995583.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25982674</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-10-20T10:15:08Z</published>
	<updated>2009-10-20T10:15:08Z</updated>
	<author>
		<name>Greg Wooledge</name>
	</author>
	<content type="html">On Tue, Oct 20, 2009 at 08:53:49AM +0300, Adriana Rodean wrote:
&lt;br&gt;&amp;gt; IPP-Linux:~# cat /var/log/auth.log | grep 18737
&lt;br&gt;&amp;gt; Oct 19 13:37:47 IPP-Linux sshd[18737]: error: bind: Address already in use
&lt;br&gt;&amp;gt; Oct 19 13:37:47 IPP-Linux sshd[18737]: error:
&lt;br&gt;&amp;gt; channel_setup_fwd_listener: cannot listen to port: 1026
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But i closed the previous console with ssh listening to that port, and
&lt;br&gt;&amp;gt; is no ssh process on client when i want to connect again on the same
&lt;br&gt;&amp;gt; port. &amp;nbsp;So how come it still says that port is in use on server?
&lt;br&gt;&lt;br&gt;Use &amp;quot;lsof -i :1026&amp;quot; (lsof is not standard, but it's very common)
&lt;br&gt;or &amp;quot;netstat -antp | grep :1026&amp;quot; (netstat -p is Linux only) to see what
&lt;br&gt;is listening on port 1026.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25982674.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25978899</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-10-20T10:03:37Z</published>
	<updated>2009-10-20T10:03:37Z</updated>
	<author>
		<name>Quintin Beukes-2</name>
	</author>
	<content type="html">Hey,
&lt;br&gt;&lt;br&gt;How do you close the console? And, can you share the command with the
&lt;br&gt;list please.
&lt;br&gt;&lt;br&gt;For some reason replying on this list does so to the sender and not to
&lt;br&gt;the list by default. So the list didn't receive the reply you did.
&lt;br&gt;&lt;br&gt;Quintin Beukes
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, Oct 20, 2009 at 7:53 AM, Adriana Rodean &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25978899&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adrya1984@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here is some more info after little investigation :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Message i get is: &amp;quot;Warning: remote port forwarding failed for listen port 1026&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SSH makes connection but port isn't opened and in server logs i see:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; IPP-Linux:~# cat /var/log/auth.log | grep 18722
&lt;br&gt;&amp;gt; Oct 19 13:37:20 IPP-Linux sshd[18722]: error: bind: Address already in use
&lt;br&gt;&amp;gt; Oct 19 13:37:20 IPP-Linux sshd[18722]: error:
&lt;br&gt;&amp;gt; channel_setup_fwd_listener: cannot listen to port: 1026
&lt;br&gt;&amp;gt; IPP-Linux:~# cat /var/log/auth.log | grep 18737
&lt;br&gt;&amp;gt; Oct 19 13:37:47 IPP-Linux sshd[18737]: error: bind: Address already in use
&lt;br&gt;&amp;gt; Oct 19 13:37:47 IPP-Linux sshd[18737]: error:
&lt;br&gt;&amp;gt; channel_setup_fwd_listener: cannot listen to port: 1026
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But i closed the previous console with ssh listening to that port, and
&lt;br&gt;&amp;gt; is no ssh process on client when i want to connect again on the same
&lt;br&gt;&amp;gt; port.  So how come it still says that port is in use on server?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This happens in only 2% of the cases, very rare, i change nothing in
&lt;br&gt;&amp;gt; the way i connect or close the client, but somehow it seems that port
&lt;br&gt;&amp;gt; still hangs on server after closing ssh console ... or at least that's
&lt;br&gt;&amp;gt; what sshd says because with &amp;quot;netstat -an&amp;quot; i don't see that port busy
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thank you Rabbi for that command, next time when it happens i'll use it :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Adriana
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25978899.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25978426</id>
	<title>Re: Manipulating Forwards on an existing shell</title>
	<published>2009-10-20T00:53:46Z</published>
	<updated>2009-10-20T00:53:46Z</updated>
	<author>
		<name>Q Beukes</name>
	</author>
	<content type="html">I know -D (socks) and ~C (then -Lx:y:z), which is what I use
&lt;br&gt;currently. And I have to use normal port forwards.
&lt;br&gt;&lt;br&gt;What I'm looking for is to make this easier with a zenity dialog at
&lt;br&gt;the click of a button, then have to terminal pipe somewhere and become
&lt;br&gt;a background process.
&lt;br&gt;&lt;br&gt;Is there perhaps some options I can supply to SSH so it accepts ~C
&lt;br&gt;(then the options + \n) from stdin?
&lt;br&gt;&lt;br&gt;Quintin Beukes
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, Oct 20, 2009 at 4:11 AM, Darren Tucker &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25978426&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dtucker@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Quintin Beukes wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Is there any way at all to manipulate local forwards on an existing
&lt;br&gt;&amp;gt;&amp;gt; shell?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Use the ~C escape, which is documented in ssh(1) thusly:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  ~C   Open command line.  Currently this allows the addition of port
&lt;br&gt;&amp;gt;      forwardings using the -L, -R and -D options (see above).  It also
&lt;br&gt;&amp;gt;      allows the cancellation of existing remote port-forwardings using
&lt;br&gt;&amp;gt;      -KR[bind_address:]port.  !command allows the user to execute a
&lt;br&gt;&amp;gt;      local command if the PermitLocalCommand option is enabled in
&lt;br&gt;&amp;gt;      ssh_config(5).  Basic help is available, using the -h option.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Depending on what you're doing, you may be better served by
&lt;br&gt;&amp;gt; -D/DynamicForward which allows you to use SOCKSified clients rather than
&lt;br&gt;&amp;gt; created new (local) forwards for each purpose.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;&amp;gt; GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;gt;    Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;&amp;gt; usually comes from bad judgement.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Manipulating-Forwards-on-an-existing-shell-tp25966687p25978426.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25978375</id>
	<title>Re: remote port forwarding unstable</title>
	<published>2009-10-19T22:53:49Z</published>
	<updated>2009-10-19T22:53:49Z</updated>
	<author>
		<name>Adrya-2</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;Here is some more info after little investigation :)
&lt;br&gt;&lt;br&gt;Message i get is: &amp;quot;Warning: remote port forwarding failed for listen port 1026&amp;quot;
&lt;br&gt;&lt;br&gt;SSH makes connection but port isn't opened and in server logs i see:
&lt;br&gt;&lt;br&gt;IPP-Linux:~# cat /var/log/auth.log | grep 18722
&lt;br&gt;Oct 19 13:37:20 IPP-Linux sshd[18722]: error: bind: Address already in use
&lt;br&gt;Oct 19 13:37:20 IPP-Linux sshd[18722]: error:
&lt;br&gt;channel_setup_fwd_listener: cannot listen to port: 1026
&lt;br&gt;IPP-Linux:~# cat /var/log/auth.log | grep 18737
&lt;br&gt;Oct 19 13:37:47 IPP-Linux sshd[18737]: error: bind: Address already in use
&lt;br&gt;Oct 19 13:37:47 IPP-Linux sshd[18737]: error:
&lt;br&gt;channel_setup_fwd_listener: cannot listen to port: 1026
&lt;br&gt;&lt;br&gt;But i closed the previous console with ssh listening to that port, and
&lt;br&gt;is no ssh process on client when i want to connect again on the same
&lt;br&gt;port. &amp;nbsp;So how come it still says that port is in use on server?
&lt;br&gt;&lt;br&gt;This happens in only 2% of the cases, very rare, i change nothing in
&lt;br&gt;the way i connect or close the client, but somehow it seems that port
&lt;br&gt;still hangs on server after closing ssh console ... or at least that's
&lt;br&gt;what sshd says because with &amp;quot;netstat -an&amp;quot; i don't see that port busy
&lt;br&gt;&lt;br&gt;Thank you Rabbi for that command, next time when it happens i'll use it :)
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Adriana
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25978375.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25978322</id>
	<title>Re: Manipulating Forwards on an existing shell</title>
	<published>2009-10-19T19:11:58Z</published>
	<updated>2009-10-19T19:11:58Z</updated>
	<author>
		<name>Darren Tucker</name>
	</author>
	<content type="html">Quintin Beukes wrote:
&lt;br&gt;&amp;gt; Is there any way at all to manipulate local forwards on an existing
&lt;br&gt;&amp;gt; shell?
&lt;br&gt;&lt;br&gt;Use the ~C escape, which is documented in ssh(1) thusly:
&lt;br&gt;&lt;br&gt;&amp;nbsp; ~C &amp;nbsp; Open command line. &amp;nbsp;Currently this allows the addition of port
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;forwardings using the -L, -R and -D options (see above). &amp;nbsp;It also
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;allows the cancellation of existing remote port-forwardings using
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-KR[bind_address:]port. &amp;nbsp;!command allows the user to execute a
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;local command if the PermitLocalCommand option is enabled in
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ssh_config(5). &amp;nbsp;Basic help is available, using the -h option.
&lt;br&gt;&lt;br&gt;Depending on what you're doing, you may be better served by 
&lt;br&gt;-D/DynamicForward which allows you to use SOCKSified clients rather than 
&lt;br&gt;created new (local) forwards for each purpose.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 &amp;nbsp;37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;usually comes from bad judgement.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Manipulating-Forwards-on-an-existing-shell-tp25966687p25978322.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25966687</id>
	<title>Manipulating Forwards on an existing shell</title>
	<published>2009-10-19T13:01:04Z</published>
	<updated>2009-10-19T13:01:04Z</updated>
	<author>
		<name>Q Beukes</name>
	</author>
	<content type="html">Hey,
&lt;br&gt;&lt;br&gt;Is there any way at all to manipulate local forwards on an existing
&lt;br&gt;shell? I basically have a script which I run to setup a bunch of port
&lt;br&gt;forwards to create a pseudo-VPN. It's much stabler through SSH than it
&lt;br&gt;is through our PPTP VPN. So it would be nice to create a zenity script
&lt;br&gt;to setup instant forwards without having to first close SSH and reopen
&lt;br&gt;it. To establish the connection takes quite long due to the
&lt;br&gt;authentication, where creating a new forward is almost instantaneous.
&lt;br&gt;Further I will also not loose my existing connections.
&lt;br&gt;&lt;br&gt;My SSH version: OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
&lt;br&gt;&lt;br&gt;It doesn't really matter if the only way to do it is dirty, because
&lt;br&gt;I'm not really aiming at portability. It's mostly only for me to use
&lt;br&gt;on my home machines.
&lt;br&gt;&lt;br&gt;Quintin Beukes
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Manipulating-Forwards-on-an-existing-shell-tp25966687p25966687.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25961851</id>
	<title>remote port forwarding unstable</title>
	<published>2009-10-19T05:31:39Z</published>
	<updated>2009-10-19T05:31:39Z</updated>
	<author>
		<name>Adrya-2</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I'm not sure if this is a bug or not, maybe someone noticed it also...
&lt;br&gt;&lt;br&gt;I always do a remote port forwarding with openssh on 1026 port let's
&lt;br&gt;say ( ssh -R 1026:localhost:55555 ). Most times the port is opened on
&lt;br&gt;remote machine. But sometimes i notice that ssh can't do remote port
&lt;br&gt;forwarding to that port 1026. I looked on the remote machine (netstat
&lt;br&gt;-an) and no one is using that port, so the port is free.
&lt;br&gt;Only way to fix this is do a remote port forwarding to another port
&lt;br&gt;lets say 1056, successfully done, then try again and do it for 1026,
&lt;br&gt;this time remote port forwarding successfully works... Sometimes it
&lt;br&gt;works if i try again with 1026, but other times i need to open another
&lt;br&gt;port then try again with 1026 port...
&lt;br&gt;&lt;br&gt;What can cause this instability to remote port forwarding?
&lt;br&gt;Is there another command than &amp;quot;netstat -an&amp;quot; to see if that port is
&lt;br&gt;really free or something is using it?
&lt;br&gt;If is a bug can it be fixed?
&lt;br&gt;&lt;br&gt;I use version of OpenSSH 5.1p1 on remote machine and the client is
&lt;br&gt;OpenSSH for Windows 3.8.1p1
&lt;br&gt;&lt;br&gt;Thanks in advance,
&lt;br&gt;Adriana
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/remote-port-forwarding-unstable-tp25961851p25961851.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25898316</id>
	<title>Re: ssh and netcat</title>
	<published>2009-10-14T11:02:05Z</published>
	<updated>2009-10-14T11:02:05Z</updated>
	<author>
		<name>Derek Martin</name>
	</author>
	<content type="html">On Mon, Oct 05, 2009 at 10:05:15AM -0700, Robert Hajime Lanning wrote:
&lt;br&gt;&amp;gt; On Fri, Oct 2, 2009 at 5:00 PM, Josef Wolf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25898316&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jw@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; This works great! But there's one drawback: at the end of every session,
&lt;br&gt;&amp;gt; &amp;gt; a &amp;quot;Killed by signal 1.&amp;quot; error is reported. This, of course, gives me a bad
&lt;br&gt;&amp;gt; &amp;gt; feeling. BTW: the signal number varies, sometimes it is 1, sometimes it
&lt;br&gt;&amp;gt; &amp;gt; is 2.
&lt;br&gt;[...]
&lt;br&gt;&amp;gt; Signal 1 is SIGHUP, the HangUP signal. &amp;nbsp;This is sent by shells, to all their
&lt;br&gt;&amp;gt; children (backgrounded commands) at exit. &amp;nbsp;It tells everything that the terminal
&lt;br&gt;&amp;gt; (modem) has hung up. &amp;nbsp;This allows the backgrounded commands to catch
&lt;br&gt;&amp;gt; that the session has ended and gracefully exit.
&lt;br&gt;&lt;br&gt;Minor correction: it's sent by the terminal driver (i.e. the kernel)
&lt;br&gt;to all processes in the foreground process's process group. &amp;nbsp;W.
&lt;br&gt;Richard Stevens has a good discussion of this in Advanced
&lt;br&gt;Programming in the Unix Environment, Chapter 10 on signals, though
&lt;br&gt;other good references exist as well. 
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Derek D. Martin
&lt;br&gt;&lt;a href=&quot;http://www.pizzashack.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.pizzashack.org/&lt;/a&gt;&lt;br&gt;GPG Key ID: 0x81CFE75D
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/25898316/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-and-netcat-tp25753833p25898316.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25790112</id>
	<title>Re: ssh and netcat</title>
	<published>2009-10-07T09:03:30Z</published>
	<updated>2009-10-07T09:03:30Z</updated>
	<author>
		<name>Josef Wolf</name>
	</author>
	<content type="html">On Tue, Oct 06, 2009 at 09:53:27AM +1100, Darren Tucker wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Josef Wolf wrote:
&lt;br&gt;&amp;gt;&amp;gt; I can get rid of this error message by deleting the &amp;quot;exec&amp;quot; keywords from
&lt;br&gt;&amp;gt;&amp;gt; the above script. But this effectively ignores the error.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So the question is: what causes this &amp;quot;Killed by signal X&amp;quot;? Is it some sort
&lt;br&gt;&amp;gt;&amp;gt; of incompatibility between ssh and netcat?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The &amp;quot;outer&amp;quot; ssh command sends a SIGHUP to the proxycommand when it shuts 
&lt;br&gt;&amp;gt; down (some versions of netcat don't check for the closure of their 
&lt;br&gt;&amp;gt; stdin/stdout and would hang around forever).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; By default, if ssh is killed by a signal it reports which one, which is 
&lt;br&gt;&amp;gt; what you're seeing (on Linux, 1=SIGHUP, 2=SIGINT).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Or am I using ssh and/or netcat
&lt;br&gt;&amp;gt;&amp;gt; in a way it was not designed for? Any ideas how to properly get rid of this
&lt;br&gt;&amp;gt;&amp;gt; error?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You can either keep doing what you're doing (without the &amp;quot;exec&amp;quot;, the ssh 
&lt;br&gt;&amp;gt; command has a parent shell, and the shell catches the SIGHUP but it does 
&lt;br&gt;&amp;gt; keep the shell process around for the duration of the connection) or tell 
&lt;br&gt;&amp;gt; ssh to be quiet and not report the signal (change &amp;quot;exec ssh foo&amp;quot; to &amp;quot;exec 
&lt;br&gt;&amp;gt; ssh -q foo&amp;quot;).
&lt;/div&gt;&lt;br&gt;Thanks for the description, Darren!
&lt;br&gt;&lt;br&gt;What would be the safe way when a real problem occurs? When I ignore the
&lt;br&gt;error (either how I did it or by telling ssh to be quiet), will e.g. scp
&lt;br&gt;properly report any problems?
&lt;br&gt;&lt;br&gt;In addition, I have one more problem with this setup: when I am localuser
&lt;br&gt;on the local host and I try to connect as remoteuser like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; git clone ssh://&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25790112&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;remoteuser@...&lt;/a&gt;/some/repository
&lt;br&gt;&lt;br&gt;then it tries to go through the proxy as &amp;quot;localuser&amp;quot;, only on the far end
&lt;br&gt;it tries to login as &amp;quot;remoteuser&amp;quot;.
&lt;br&gt;&lt;br&gt;So the question extends to: is there a way to find out from the proxycommand
&lt;br&gt;as which user the connection should be done on the far end?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-and-netcat-tp25753833p25790112.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25771751</id>
	<title>Re: ssh and netcat</title>
	<published>2009-10-05T15:53:27Z</published>
	<updated>2009-10-05T15:53:27Z</updated>
	<author>
		<name>Darren Tucker</name>
	</author>
	<content type="html">Josef Wolf wrote:
&lt;br&gt;&amp;gt; I can get rid of this error message by deleting the &amp;quot;exec&amp;quot; keywords from
&lt;br&gt;&amp;gt; the above script. But this effectively ignores the error.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So the question is: what causes this &amp;quot;Killed by signal X&amp;quot;? Is it some sort
&lt;br&gt;&amp;gt; of incompatibility between ssh and netcat?
&lt;br&gt;&lt;br&gt;The &amp;quot;outer&amp;quot; ssh command sends a SIGHUP to the proxycommand when it shuts 
&lt;br&gt;down (some versions of netcat don't check for the closure of their 
&lt;br&gt;stdin/stdout and would hang around forever).
&lt;br&gt;&lt;br&gt;By default, if ssh is killed by a signal it reports which one, which is 
&lt;br&gt;what you're seeing (on Linux, 1=SIGHUP, 2=SIGINT).
&lt;br&gt;&lt;br&gt;&amp;gt; Or am I using ssh and/or netcat
&lt;br&gt;&amp;gt; in a way it was not designed for? Any ideas how to properly get rid of this
&lt;br&gt;&amp;gt; error?
&lt;br&gt;&lt;br&gt;You can either keep doing what you're doing (without the &amp;quot;exec&amp;quot;, the ssh 
&lt;br&gt;command has a parent shell, and the shell catches the SIGHUP but it does 
&lt;br&gt;keep the shell process around for the duration of the connection) or 
&lt;br&gt;tell ssh to be quiet and not report the signal (change &amp;quot;exec ssh foo&amp;quot; to 
&lt;br&gt;&amp;quot;exec ssh -q foo&amp;quot;).
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Darren Tucker (dtucker at zip.com.au)
&lt;br&gt;GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 &amp;nbsp;37C9 C982 80C7 8FF4 FA69
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Good judgement comes with experience. Unfortunately, the experience
&lt;br&gt;usually comes from bad judgement.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-and-netcat-tp25753833p25771751.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25771688</id>
	<title>Re: ssh and netcat</title>
	<published>2009-10-05T10:05:15Z</published>
	<updated>2009-10-05T10:05:15Z</updated>
	<author>
		<name>Robert Hajime Lanning</name>
	</author>
	<content type="html">On Fri, Oct 2, 2009 at 5:00 PM, Josef Wolf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=25771688&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jw@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; This works great! But there's one drawback: at the end of every session,
&lt;br&gt;&amp;gt; a &amp;quot;Killed by signal 1.&amp;quot; error is reported. This, of course, gives me a bad
&lt;br&gt;&amp;gt; feeling. BTW: the signal number varies, sometimes it is 1, sometimes it
&lt;br&gt;&amp;gt; is 2.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I can get rid of this error message by deleting the &amp;quot;exec&amp;quot; keywords from
&lt;br&gt;&amp;gt; the above script. But this effectively ignores the error.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So the question is: what causes this &amp;quot;Killed by signal X&amp;quot;? Is it some sort
&lt;br&gt;&amp;gt; of incompatibility between ssh and netcat? Or am I using ssh and/or netcat
&lt;br&gt;&amp;gt; in a way it was not designed for? Any ideas how to properly get rid of this
&lt;br&gt;&amp;gt; error?
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;It is a normal exit mode.
&lt;br&gt;&lt;br&gt;Signal 1 is SIGHUP, the HangUP signal. &amp;nbsp;This is sent by shells, to all their
&lt;br&gt;children (backgrounded commands) at exit. &amp;nbsp;It tells everything that the terminal
&lt;br&gt;(modem) has hung up. &amp;nbsp;This allows the backgrounded commands to catch
&lt;br&gt;that the session has ended and gracefully exit.
&lt;br&gt;&lt;br&gt;Signal 2 in SIGINT, the Interrupt signal. &amp;nbsp;This is generated by CTRL-C. And is
&lt;br&gt;passed by the shell to the process group of the current running command.
&lt;br&gt;&lt;br&gt;What you are seeing is a race condition. &amp;nbsp;The signal is reaching the
&lt;br&gt;process faster
&lt;br&gt;than the closing of the pipes (normal exit.) &amp;nbsp;By not having the &amp;quot;exec&amp;quot;
&lt;br&gt;key word, there
&lt;br&gt;is one more level of process tree that the signal has to traverse.
&lt;br&gt;This is slowing it
&lt;br&gt;down just enough, so the detection of the closed pipe happens, before
&lt;br&gt;it sees the
&lt;br&gt;signal. &amp;nbsp;So, without the &amp;quot;exec&amp;quot; the error condition is actually not
&lt;br&gt;being ignored, it is
&lt;br&gt;just not happening.
&lt;br&gt;&lt;br&gt;In the end, the &amp;quot;error&amp;quot; can be ignored.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;And, did Galoka think the Ulus were too ugly to save?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-Centauri
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-and-netcat-tp25753833p25771688.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-25753833</id>
	<title>ssh and netcat</title>
	<published>2009-10-02T17:00:21Z</published>
	<updated>2009-10-02T17:00:21Z</updated>
	<author>
		<name>Josef Wolf</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;a while ago, I asked this list about usage of the ProxyCommand. As a
&lt;br&gt;response, Darren Tucker gave me a great suggestion in this post:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.mail-archive.com/secureshell@securityfocus.com/msg02638.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/secureshell@.../msg02638.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;I then tried to build upon Darren's idea:
&lt;br&gt;&lt;br&gt;&amp;nbsp; # dns.name is how we find the IP for the gateway to the net
&lt;br&gt;&amp;nbsp; # domain.name is my private name for the network
&lt;br&gt;&amp;nbsp; Host *.domain.name
&lt;br&gt;&amp;nbsp; ProxyCommand /usr/bin/sshproxy dns.name gateway.domain.name %h %p
&lt;br&gt;&lt;br&gt;and here`s the corresponding sshproxy:
&lt;br&gt;&lt;br&gt;&amp;nbsp; #! /bin/sh
&lt;br&gt;&amp;nbsp; extdns=$1
&lt;br&gt;&amp;nbsp; gateway=$2
&lt;br&gt;&amp;nbsp; host=$3
&lt;br&gt;&amp;nbsp; port=$4
&lt;br&gt;&amp;nbsp; DOMAIN=`hostname -d|sed 's/\./\\\./g'`
&lt;br&gt;&amp;nbsp; netcat=&amp;quot;netcat -w1 $host $port&amp;quot;
&lt;br&gt;&amp;nbsp; if echo $host | egrep &amp;quot;$DOMAIN$&amp;quot; &amp;gt;/dev/null ; then
&lt;br&gt;&amp;nbsp; &amp;nbsp; # we are already on the target network, no proxy needed
&lt;br&gt;&amp;nbsp; &amp;nbsp; exec $netcat
&lt;br&gt;&amp;nbsp; else
&lt;br&gt;&amp;nbsp; &amp;nbsp; if [ &amp;quot;x$host&amp;quot; = &amp;quot;x$gateway&amp;quot; ] ; then
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # we're connecting to the gateway. take in account that it's external
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # name is different from the name we called him
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; exec ssh -o &amp;quot;HostKeyAlias $gateway&amp;quot; $extdns $netcat
&lt;br&gt;&amp;nbsp; &amp;nbsp; else
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # we're going behind the gateway. Use the gateway as a hop to the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # real destination.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; exec ssh $gateway $netcat
&lt;br&gt;&amp;nbsp; &amp;nbsp; fi
&lt;br&gt;&amp;nbsp; fi
&lt;br&gt;&lt;br&gt;This works great! But there's one drawback: at the end of every session,
&lt;br&gt;a &amp;quot;Killed by signal 1.&amp;quot; error is reported. This, of course, gives me a bad
&lt;br&gt;feeling. BTW: the signal number varies, sometimes it is 1, sometimes it
&lt;br&gt;is 2.
&lt;br&gt;&lt;br&gt;I can get rid of this error message by deleting the &amp;quot;exec&amp;quot; keywords from
&lt;br&gt;the above script. But this effectively ignores the error.
&lt;br&gt;&lt;br&gt;So the question is: what causes this &amp;quot;Killed by signal X&amp;quot;? Is it some sort
&lt;br&gt;of incompatibility between ssh and netcat? Or am I using ssh and/or netcat
&lt;br&gt;in a way it was not designed for? Any ideas how to properly get rid of this
&lt;br&gt;error?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ssh-and-netcat-tp25753833p25753833.html" />
</entry>

</feed>
