debian/0000755000000000000000000000000012145241203007160 5ustar debian/patches/0000755000000000000000000000000012145233334010615 5ustar debian/patches/series0000644000000000000000000000020012145233334012022 0ustar 010_override_cmdline_port.diff 020_use_destdir_makefile.diff 022_pass_ldflags.diff 030_manpage_fix.diff 040_manpage_debian.diff debian/patches/040_manpage_debian.diff0000644000000000000000000000116212145142055014743 0ustar Add debian-specific behaviour to the man page. Index: autossh/autossh.1 =================================================================== --- autossh.orig/autossh.1 2011-11-19 02:57:51.000000000 +0100 +++ autossh/autossh.1 2011-11-19 02:59:13.000000000 +0100 @@ -268,6 +268,12 @@ .Fl M flag. A value of 0 turns the monitoring function off. .El +.Sh DEBIAN-SPECIFIC BEHAVIOR +The debian version of autossh uses a wrapper to automatically select a free +monitoring port and +.Fl M +overrides AUTOSSH_PORT, see +/usr/share/doc/autossh/README.Debian for further information. .Sh AUTHOR .Nm was written by Carson Harding. debian/patches/030_manpage_fix.diff0000644000000000000000000000540212145142055014307 0ustar Fix some stuff in the man page. (Should be better sent to upstream. :-) Index: autossh/autossh.1 =================================================================== --- autossh.orig/autossh.1 2011-11-19 02:34:15.000000000 +0100 +++ autossh/autossh.1 2011-11-19 02:57:51.000000000 +0100 @@ -60,7 +60,6 @@ .Nm tries to distinguish the manner of death of the ssh process it is monitoring and act appropriately. The rules are: -.Bl -tag -width Ds .It 1. If the ssh process exited normally (for example, someone typed "exit" in an interactive session), @@ -126,14 +125,14 @@ poll time (usually 10 minutes). .Nm can be "prodded" to retry by signalling it, perhaps with -SIGHUP ("kill -HUP"). +SIGHUP ("kill \-HUP"). .Pp .Ss Connection setup .Pp As connections must be established unattended, the use of .Nm requires that some form of automatic authentication be set up. The use -of RSAAuthentication with ssh-agent is the recommended method. The +of RSAAuthentication with ssh\-agent is the recommended method. The example wrapper script attempts to check if there is an agent running for the current environment, and to start one if there isn't. .Pp @@ -160,8 +159,8 @@ using. .Nm will send test data on the base monitoring port, and -receive it back on the port above. For example, if you specify "-M -20000", +receive it back on the port above. For example, if you specify +.Dq Fl M 20000 , .Nm will set up forwards so that it can send data on port 20000 and receive it back on 20001. @@ -241,12 +240,14 @@ .It Ev AUTOSSH_MAXSTART Specifies how many times ssh should be started. A negative number means no limit on the number of times ssh is started. The default -value is -1. +value is \-1. .It Ev AUTOSSH_MESSAGE Append message to echo message sent when testing connections. .It Ev AUTOSSH_NTSERVICE (Cygwin only.) When set to "yes" , autossh sets up to run as an NT -service under cygrunsrv. This adds the -N flag for ssh if not already +service under cygrunsrv. This adds the +.Fl N +flag for ssh if not already set, sets the log output to stdout, and changes the behaviour on ssh exit so that it will restart even on a normal exit. .It Ev AUTOSSH_PATH @@ -261,15 +262,18 @@ poll time. .It Ev AUTOSSH_PORT Sets the connection monitoring port. Mostly in case ssh appropriates --M at some time. But because of this possible use, AUTOSSH_PORT -overrides the -M flag. A value of 0 turns the monitoring function off. +.Fl M +at some time. But because of this possible use, AUTOSSH_PORT +overrides the +.Fl M +flag. A value of 0 turns the monitoring function off. .El .Sh AUTHOR .Nm was written by Carson Harding. .Sh SEE ALSO .Xr ssh 1 , -.Xr ssh-add 1 , -.Xr ssh-agent 1 , -.Xr ssh-keygen 1 , +.Xr ssh\-add 1 , +.Xr ssh\-agent 1 , +.Xr ssh\-keygen 1 , .Xr cygrunsrv 1 . debian/patches/022_pass_ldflags.diff0000644000000000000000000000103312145233334014471 0ustar Description: Properly pass LDFLAGS. Fixes lintian warning hardening-no-relro Author: Axel Beckert Index: autossh/Makefile.in =================================================================== --- autossh.orig/Makefile.in 2013-05-16 14:51:47.000000000 +0200 +++ autossh/Makefile.in 2013-05-16 14:53:19.000000000 +0200 @@ -31,7 +31,7 @@ $(TARGET): $(OFILES) - $(CC) $(CPPFLAGS) -o $(TARGET) $(OFILES) $(LIBS) + $(CC) $(CPPFLAGS) $(LDFLAGS) -o $(TARGET) $(OFILES) $(LIBS) clean: - /bin/rm -f *.o *.a *.core *~ debian/patches/010_override_cmdline_port.diff0000644000000000000000000000310612145142055016404 0ustar Switches priority of -M commandline option and $AUTOSSH_PORT environment variable. Index: autossh/autossh.c =================================================================== --- autossh.orig/autossh.c 2011-11-19 02:48:58.000000000 +0100 +++ autossh/autossh.c 2011-11-19 02:49:09.000000000 +0100 @@ -183,7 +183,7 @@ if (code) { fprintf(stderr, "\n"); fprintf(stderr, - " -M specifies monitor port. May be overridden by" + " -M specifies monitor port. Overrides the" " environment\n" " variable AUTOSSH_PORT. 0 turns monitoring" " loop off.\n" @@ -282,14 +282,17 @@ */ get_env_args(); - /* + /* if we got it from the environment */ + if (env_port) + writep = env_port; + + /* * We accept all ssh args, and quietly pass them on * to ssh when we call it. */ while ((ch = getopt(argc, argv, OPTION_STRING)) != -1) { switch(ch) { case 'M': - if (!env_port) writep = optarg; break; case 'V': @@ -313,9 +316,6 @@ } } - /* if we got it from the environment */ - if (env_port) - writep = env_port; /* * We must at least have a monitor port and a remote host. @@ -409,7 +409,7 @@ continue; } } - if (wp && env_port && !done_fwds) { + if (wp && !done_fwds) { add_arg("-L"); add_arg(wmbuf); if (!echop) { @@ -417,7 +417,8 @@ add_arg(rmbuf); } done_fwds = 1; - } else if (!sawargstop && argv[i][0] == '-' && argv[i][1] == 'M') { + } + if (!sawargstop && argv[i][0] == '-' && argv[i][1] == 'M') { if (argv[i][2] == '\0') i++; if (wp && !done_fwds) { debian/patches/020_use_destdir_makefile.diff0000644000000000000000000000063412145142055016201 0ustar Support for $DESTDIR in the Makefile. Index: autossh/Makefile.in =================================================================== --- autossh.orig/Makefile.in 2011-06-05 00:10:01.000000000 +0200 +++ autossh/Makefile.in 2011-06-05 00:26:15.000000000 +0200 @@ -6,7 +6,7 @@ SSH= @path_ssh@ -prefix= @prefix@ +prefix= ${DESTDIR}@prefix@ exec_prefix= @exec_prefix@ bindir= @bindir@ datadir= @datadir@ debian/autossh-argv00000644000000000000000000000314712145142055011620 0ustar #! /bin/sh -e # Adapted from ssh-argv0 for usage with autossh # Note: the ssh-argv0(1) manpage is left as-is because autossh is meant as a # commandline replacement for ssh # Copyright (c) 2001 Jonathan Amery. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if [ "${0##*/}" = "autossh-argv0" ] then echo 'autossh-argv0: This script should not be run like this, see ssh-argv0(1) and autossh(1) for details' 1>&2 exit 1 fi exec autossh "${0##*/}" "$@" debian/lintian-overrides0000644000000000000000000000014512145142055012546 0ustar autossh binary: package-contains-broken-symlink usr/share/man/man1/autossh-argv0.1.gz ssh-argv0.1.gz debian/README.source0000644000000000000000000000353512145142055011352 0ustar This package uses quilt to manage all modifications to the upstream source. Changes are stored in the source package as diffs in debian/patches and applied during the build. To configure quilt to use debian/patches instead of patches, you want either to export QUILT_PATCHES=debian/patches in your environment or use this snippet in your ~/.quiltrc: for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then export QUILT_PATCHES=debian/patches break fi done To get the fully patched source after unpacking the source package, cd to the root level of the source package and run: quilt push -a The last patch listed in debian/patches/series will become the current patch. To add a new set of changes, first run quilt push -a, and then run: quilt new where is a descriptive name for the patch, used as the filename in debian/patches. Then, for every file that will be modified by this patch, run: quilt add before editing those files. You must tell quilt with quilt add what files will be part of the patch before making changes or quilt will not work properly. After editing the files, run: quilt refresh to save the results as a patch. Alternately, if you already have an external patch and you just want to add it to the build system, run quilt push -a and then: quilt import -P /path/to/patch quilt push -a (add -p 0 to quilt import if needed). as above is the filename to use in debian/patches. The last quilt push -a will apply the patch to make sure it works properly. To remove an existing patch from the list of patches that will be applied, run: quilt delete You may need to run quilt pop -a to unapply patches first before running this command. debian/logcheck.ignore.workstation0000644000000000000000000000067012145142055014537 0ustar ^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ autossh\[[[:digit:]]+\]: starting ssh \(count [[:digit:]]+\)$ ^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ autossh\[[[:digit:]]+\]: ssh child pid is [[:digit:]]+$ ^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ autossh\[[[:digit:]]+\]: ssh exited prematurely with status [[:digit:]]+; autossh exiting$ ^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ autossh\[[[:digit:]]+\]: received signal to exit \([[:digit:]]+\)$ debian/compat0000644000000000000000000000000212145233213010360 0ustar 9 debian/watch0000644000000000000000000000010012145142055010205 0ustar version=3 http://www.harding.motd.ca/autossh/autossh-(.*)\.tgz debian/changelog0000644000000000000000000002371512145240405011045 0ustar autossh (1.4c-2) unstable; urgency=low * Merge debian/autossh.dirs and debian/dirs * Rename autossh.lintian-overrides to lintian-overrides * Bump debhelper compatibility to 9 to make use of the following features: - dh_clean will delete toplevel *-stamp files - dh_installchangelogs will guess at what file is the upstream changelog if none is specified - dh_auto_{configure,build} pass dpkg-buildflags automatically * Revamp debian/rules: - Use dh_auto_{configure,build,clean} - Drop manual DEB_HOST_GNU_TYPE and DEB_BUILD_GNU_TYPE handling. - Use debian/links instead of "ln -s" - Finally switch to a minimal dh7 style debian/rules file * Switch to source format "3.0 (quilt)" - Drop build-dependency on quilt * Add patch to properly pass LDFLAGS - Fixes lintian warning hardening-no-relro * Bump Standards-Version to 3.9.4 (no changes) * Apply wrap-and-sort -- Axel Beckert Thu, 16 May 2013 22:26:02 +0200 autossh (1.4c-1) unstable; urgency=low * New upstream bugfix release - Drop patch 000_configure_with-ssh_fix.diff (applied upstream) - Refreshed patches 010_override_cmdline_port.diff and 040_manpage_debian.diff - Removed hunks from patch 030_manpage_fix.diff which have been applied upstream, refresh the rest. * Add recommended build-arch and build-indep targets to debian/rules, fixes lintian warning debian-rules-missing-recommended-target. * Add lintian override for package-contains-broken-symlink (as that symlink points to a file from a dependency) * Make debian/rscreen to also work with tmux. + Install symbolic links rtmux and ruscreen (for enforcing UTF-8) to rscreen + Mention debian/rscreen in debian/copyright. * Make debian/rscreen and its symlinks source /etc/${BASENAME}rc and ~/.${BASENAME}rc * Make debian/rscreen honour -h and --help, make usage message more verbose. -- Axel Beckert Sat, 19 Nov 2011 03:41:58 +0100 autossh (1.4b-6) unstable; urgency=low * Build-Depend on openssh-client to allow configure to find the path to the ssh binary. -- Axel Beckert Mon, 25 Jul 2011 02:28:28 +0200 autossh (1.4b-5) unstable; urgency=low * New Maintainers (Closes: #605423) + Move to Git (new Vcs-* headers) * Bump Standards-Version to 3.9.2 (no changes) * Add "Enhances: openssh-client, ssh-client" * Move from cdbs+simple-patchsys to debhelper+quilt + Refreshed all patches and added descriptions + Update build dependencies appropriately + Install autossh and autossh-argv0 via dh_install + Install logcheck stuff via dh_installlogcheck + Use dh_autotools-dev_*config instead of manually handling config.{sub,guess} * Remove deletion of no more created directories and files * Install (slightly modified) example script rscreen to /usr/bin (LP: #410357) * Do not link against libnsl (fixes dpkg-shlibdeps warning) * Add README.source from /usr/share/doc/quilt/ to make Lintian happy -- Axel Beckert Mon, 25 Jul 2011 01:24:55 +0200 autossh (1.4b-4) unstable; urgency=low [ Thorsten Glaser ] * debian/patches/000_configure_with-ssh_fix.diff: Remove, create a proper fix in debian/patches/000_configure_fix.diff (the closing parenthesis of AC_HELP_STRING was placed wrong) * debian/patches/000_configure_fix.diff: Add proper check for the existence of __progname (taken from OpenSSH-portable), replace upstream’s check for declaration when what we really need to see is existence of the symbol (Closes: #531937) * debian/control: Remove “Tag:” header lintian complains about, see the following mailing list thread for the reason: - http://lists.alioth.debian.org/pipermail/debtags-devel/2007-January/001567.html - http://lists.alioth.debian.org/pipermail/debtags-devel/2007-February/001593.html * Fix a couple of lintian warnings: - debian/README.Debian: spelling-error-in-readme-debian - debian/patches/030_manpage_fix.diff, debian/patches/040_manpage_debian.diff: hyphen-used-as-minus-sign * Bump Standards-Version to 3.8.3, no relevant changes * Call autoconf and autoheader to regenerate buildsystem after patching * Fix spelling error in debian/patches/040_manpage_debian.diff [ Filippo Giunchedi ] * Merge patch from Thorsten Glaser fixing also an RC bug, thanks! -- Filippo Giunchedi Sun, 10 Jan 2010 11:21:00 +0100 autossh (1.4b-3) unstable; urgency=low * Cosmetic changes to autossh wrapper * Fix FTBFS on mips/mipsel by adding -fPIC to CFLAGS (Closes: #531937) -- Filippo Giunchedi Fri, 05 Jun 2009 19:08:51 +0200 autossh (1.4b-2) unstable; urgency=low * Include autossh-argv0 shamelessly copied/adapted from ssh-argv0 * Add debian/patches/040_manpage_debian.diff to reference README.Debian for autossh debian-specific behavior (Closes: #523861) * Install logcheck ignore rules into /etc/logcheck/ignore.d.workstation/autossh (Closes: #505659) * Add ${misc:Depends} as lintian requested * Update to S-V 3.8.1, no changes needed -- Filippo Giunchedi Sat, 23 May 2009 19:08:46 +0200 autossh (1.4b-1) unstable; urgency=low * New upstream release * debian/patches/manpage_fix.diff: fix spurious .El (Closes: #447654) * Report failure when unable to find a tunnel port (Closes: #443087) -- Filippo Giunchedi Tue, 24 Jun 2008 13:01:25 +0200 autossh (1.4a-3) unstable; urgency=low * get command line handling of -M right. * add NEWS file announcing the random guess feature -- Filippo Giunchedi Mon, 01 Oct 2007 23:34:18 +0200 autossh (1.4a-2) unstable; urgency=low * fix configure to properly handle --with-ssh * pass --with-ssh=/usr/bin/ssh to configure * improved the autossh wrapper while testing random ports -- Filippo Giunchedi Mon, 01 Oct 2007 23:26:06 +0200 autossh (1.4a-1) unstable; urgency=low * New upstream release (Closes: #389985) * migration to cdbs * split patch for overriding -M on commandline into debian/patches * the autossh wrapper now tries random ports (Closes: #230780) * fix typo in the manpage and the bullet list (Closes: #441035) -- Filippo Giunchedi Fri, 28 Sep 2007 11:57:04 +0200 autossh (1.3-4) unstable; urgency=low * explicitly depend on ssh-client | openssh-client (Closes: #315049) * pass -M to ssh if used after --, patch by Paul Brook (Closes: #320280) -- Filippo Giunchedi Thu, 15 Sep 2005 10:47:04 +0200 autossh (1.3-3) unstable; urgency=low * fixed weird bug when AUTOSSH_PORT and -M are present -- Filippo Giunchedi Sun, 26 Jun 2005 19:45:35 +0200 autossh (1.3-2) unstable; urgency=low * changed Depends: ssh to Depends: ssh-client since ssh is now a transitional package (Closes: #315049) -- Filippo Giunchedi Mon, 20 Jun 2005 13:06:16 +0200 autossh (1.3-1) unstable; urgency=low * new upstream release * fixed bad strcpy() usage * backported default behaviour, -M overrides environment as expected -- Filippo Giunchedi Sat, 18 Jun 2005 21:48:14 +0200 autossh (1.2g-3) unstable; urgency=low * fixed strcpy() with overlapping strings as pointed out by Steve Langasek -- Filippo Giunchedi Tue, 24 May 2005 18:31:24 +0200 autossh (1.2g-2) unstable; urgency=low * fixes important bug when AUTOSSH_PORT=0 (Closes: #309744) * do not strip "f" from arguments passed to ssh (backported from autossh 1.3) -- Filippo Giunchedi Thu, 19 May 2005 14:41:12 +0200 autossh (1.2g-1) unstable; urgency=low * New upstream release * added sponsor martin f krafft as uploader * -M from the commandline overrides enviroment AUTOSSH_PORT, this changes upstram's behaviour. see #238148 * moved /usr/bin/autossh.real to /usr/lib/autossh/autossh and removed the lintian override, thanks to martin f krafft -- Filippo Giunchedi Mon, 16 Nov 2004 20:53:57 +0100 autossh (1.2f-3) unstable; urgency=low * fixed -M and AUTOSSH_PORT handling, this should now work as expected (i.e. -M overrides enviroment) -- Filippo Giunchedi Fri, 2 Apr 2004 22:44:26 +0200 autossh (1.2f-2) unstable; urgency=low * changed autossh_wrapper to use AUTOSSH_PORT instead of -M and modified autossh.c to -M always override AUTOSSH_PORT (Closes: #238148) * fixed autossh chocking on empty (but set) AUTOSSH_PORT (Closes: #238150) -- Filippo Giunchedi Fri, 19 Mar 2004 17:34:19 +0100 autossh (1.2f-1) unstable; urgency=low * New upstream version, fixed -f behaviour * increased timeout to 15 seconds, removed unused variable, fixed manpage typo, patch by Michael Shields (Closes: #233567, #233568) * added lintian override for autossh.real -- Filippo Giunchedi Mon, 23 Feb 2004 12:10:18 +0100 autossh (1.2e-2) unstable; urgency=low * fixed argument passing in autossh wrapper plus exec, patch by Gael Queri (Closes: #228371) * updated Standards-Version and minor changes -- Filippo Giunchedi Sun, 19 Jan 2004 23:00:30 +0100 autossh (1.2e-1) unstable; urgency=low * New upstream release * fixed -f handling in new release (Closes: #191719) -- Filippo Giunchedi Sat, 15 Nov 2003 14:02:58 +0100 autossh (1.2d-1) unstable; urgency=low * New upstream release * /usr/bin/autossh is a wrapper to set autossh.real default port [21021] (Closes: #177511) -- Filippo Giunchedi Fri, 20 Jun 2003 22:25:22 +0200 autossh (1.2c-2) unstable; urgency=low * updated Standards-Version * removed dh_make boilerplate in copyright (now lintian error-free) -- Filippo Giunchedi Sat, 11 Jan 2003 17:56:41 +0100 autossh (1.2c-1) unstable; urgency=low * Initial Release. -- Filippo Giunchedi Mon, 23 Dec 2002 16:36:39 +0000 debian/copyright0000644000000000000000000000244512145235311011123 0ustar This package was debianized by Filippo Giunchedi on Mon, 23 Dec 2002 16:36:39 +0000. It was downloaded from http://www.harding.motd.ca/autossh/ Upstream Author: Carson Harding Copyright: Copyright (c) Carson Harding, 2002. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are freely permitted. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/rscreen is Copyright (C) Carson Harding, 2002. Copyright (C) Axel Beckert, 2011. and licensed under the same terms as autossh itself and the original rscreen by Carson Harding. debian/autossh_wrapper0000644000000000000000000000271212145142055012340 0ustar #!/bin/sh # little wrapper to choose a random port for autossh, falling back to $fallback_port fallback_port="21021" tcpstat="/proc/net/tcp" # take an hex port and check whether it is in use (i.e. locally bound) in # $tcpstat # unix command semantics: if in use return 0 else return 1 port_in_use() { if egrep -q "^[0-9 ]+: [0-9A-F]{8}:$1" $tcpstat ; then return 0 else return 1 fi } echo "$@" | egrep -q -- '-f?M ?[0-9]+' # backward compatibility, skip guess if -M is passed if [ $? -gt 0 ] && [ -z "$AUTOSSH_PORT" ]; then portguess="" if [ -r "/dev/urandom" ] && [ -r "$tcpstat" ]; then for t in $(seq 1 42); do # get a random hex randport=$( od -x -N2 -An /dev/urandom | tr -d ' ' ) # increase it a little "bit" randport=$( /usr/bin/printf "%04x" $(( 0x$randport | 0x8000 )) ) randport_1=$( /usr/bin/printf "%04x" $(( 0x$randport + 1 )) ) # check if port is in use, possibile race condition between here # and the exec if ! port_in_use $randport && ! port_in_use $randport_1; then portguess=$(( 0x$randport )) break fi done fi if [ -z "$portguess" ]; then fallback=$( /usr/bin/printf "%04x" $fallback_port ) fallback_1=$( /usr/bin/printf "%04x" $(( 0x$fallback + 1 )) ) if ! port_in_use $fallback && ! port_in_use $fallback_1; then portguess=$fallback_port else echo "unable to find a suitable tunnel port" exit 1 fi fi export AUTOSSH_PORT="$portguess" fi exec /usr/lib/autossh/autossh "$@" debian/examples0000644000000000000000000000002512145142055010723 0ustar autossh.host rscreen debian/docs0000644000000000000000000000000712145142055010035 0ustar README debian/control0000644000000000000000000000214312145235311010566 0ustar Source: autossh Section: net Priority: optional Maintainer: Axel Beckert Uploaders: Franziska Lichtblau Build-Depends: autoconf (>= 2.59), autotools-dev, debhelper (>= 9~), openssh-client Build-Conflicts: autoconf2.13 Homepage: http://www.harding.motd.ca/autossh/ Vcs-Git: git://anonscm.debian.org/collab-maint/autossh.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/autossh.git Standards-Version: 3.9.4 Package: autossh Architecture: any Depends: openssh-client | ssh-client, ${misc:Depends}, ${shlibs:Depends} Enhances: openssh-client, ssh-client Description: Automatically restart SSH sessions and tunnels autossh is a program to start an instance of ssh and monitor it, restarting it as necessary should it die or stop passing traffic. The idea is from rstunnel (Reliable SSH Tunnel), but implemented in C. Connection monitoring is done using a loop of port forwardings. It backs off on the rate of connection attempts when experiencing rapid failures such as connection refused. debian/README.Debian0000644000000000000000000000103312145142055011223 0ustar autossh for Debian README ========================= autossh is wrapped to choose a random port or fall back to 21021 the real binary is /usr/lib/autossh/autossh In this version of autossh the commandline switch -M overrides AUTOSSH_PORT environment, as opposed to default upstream behaviour (see http://bugs.debian.org/238150#msg6 and following) Note: if your ssh client/server version is recent enough you can obtain similar behaviour by setting ClientAliveCountMax and ServerAliveInterval in /etc/ssh/sshd_config. See sshd_config(5). debian/dirs0000644000000000000000000000011612145142055010047 0ustar usr usr/bin usr/share/doc/autossh/examples usr/lib/autossh usr/share/man/man1 debian/source/0000755000000000000000000000000012145233306010465 5ustar debian/source/format0000644000000000000000000000001412145233306011673 0ustar 3.0 (quilt) debian/rscreen0000755000000000000000000000430312145142055010554 0ustar #!/bin/sh # # Script to use autossh to open up a remote screen session, or # reconnect to an existing one. Based on autossh's original rscreen # example script as installed on Debian systems into # /usr/share/doc/autossh/rscreen, but with more generally usable # defaults # # Copyright (C) Carson Harding, 2002. # Copyright (C) Axel Beckert, 2011. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are freely permitted. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL # THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # BASENAME=`basename $0` usage() { echo < If \$RSCREEN_COMMAND is set (either in the environment, in /etc/${BASENAME}rc, or in ~/.${BASENAME}rc), it will be used instead of screen or tmux. Use this feature if you want to supply additional screen options or tmux commands. (Using \$RTMUX_COMMAND does not work!) EOF } if [ -z "$1" ]; then usage exit 1 elif [ "$1" = "-h" -o "$1" = "--help" ]; then usage exit 0 fi if [ -r /etc/${BASENAME}rc ]; then . /etc/${BASENAME}rc fi if [ -r ~/.${BASENAME}rc ]; then . ~/.${BASENAME}rc fi if [ -z "$SSH_AUTH_SOCK" ]; then eval `ssh-agent -s` ssh-add fi if [ -n "$RSCREEN_COMMAND" ]; then exec autossh -t "$@" "$RSCREEN_COMMAND" elif [ "$BASENAME" = "rtmux" ]; then exec autossh -t "$@" "tmux a || tmux new" elif [ "$BASENAME" = "ruscreen" ]; then # screen with explicit UTF-8 setting exec autossh -t "$@" "screen -RdU" else # Fall back to normal screen exec autossh -t "$@" "screen -Rd" fi debian/links0000644000000000000000000000021512145233334010227 0ustar /usr/share/man/man1/ssh-argv0.1.gz /usr/share/man/man1/autossh-argv0.1.gz /usr/bin/rscreen /usr/bin/rtmux /usr/bin/rscreen /usr/bin/ruscreen debian/manpages0000644000000000000000000000001212145142055010674 0ustar autossh.1 debian/install0000644000000000000000000000011712145235311010553 0ustar autossh usr/lib/autossh debian/autossh-argv0 usr/bin debian/rscreen usr/bin debian/NEWS0000644000000000000000000000062712145142055007671 0ustar autossh (1.4a-3) unstable; urgency=low Automatic (random) guess of the port has been introduced, this means you can invoke autossh without specifying -M . Backward compatibility is retained, you are free to use -M to force a specific monitor port or use autossh -- -M for passing -M to ssh. -- Filippo Giunchedi Mon, 08 Oct 2007 22:29:54 +0200 debian/rules0000755000000000000000000000047512145234721010255 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --with autotools-dev override_dh_auto_configure: dh_auto_configure sed -e 's/-lnsl//g' -i Makefile override_dh_auto_install: install -m0755 $(CURDIR)/debian/autossh_wrapper \ $(CURDIR)/debian/autossh/usr/bin/autossh