Jay Taylor's notes
back to listing indexCreating persistent SSH tunnels in Windows using autossh | boltblog
[web search]
Original source (blog.dhampir.no)
Clipped on: 2015-05-07
old-school tech and modern annoyances
Categories
Way back in…
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- August 2014
- July 2014
- April 2014
- March 2014
- December 2013
- September 2013
- July 2013
- April 2013
- March 2013
- January 2013
- December 2012
- August 2012
- March 2012
- February 2012
- January 2012
- October 2011
- September 2011
- August 2011
- July 2011
- May 2011
- February 2011
- January 2011
- November 2010
- October 2010
- September 2010
- August 2010
- June 2010
- November 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- October 2008
- August 2008
- July 2008
- June 2008
Cows eat grass.
Zombies eat brains.
- 1Download Cygwin (http://www.cygwin.com/)
- 2Install Cygwin, selecting the autossh package.
- 3Start the Cygwin shell (Start → Programs → Cygwin).
- 4Generate a public/private key pair.
- 0At the command line, run: ssh-keygen
- 0Accept the default file locations
- 0Use an empty passphrase
- 1Copy your newly-created public key to the SSH server.
- 0scp .ssh/id_rsa.pub user@ssh.host.name:id_rsa.pub
- 1Add your public key to your list of authorized keys on the server.
- 0Login to your SSH server.
- 0mkdir .ssh
- 0cat id_rsa.pub >> .ssh/authorized_keys
- 1Test your key.
- 0Logout of your SSH sever.
- 0Login to your SSH server again. This time, your key will be used for authentication and you won’t be challenged for your login credentials. If you are not logged in automatically, review the previous steps. Or contact your server administrator.
- 0Logout of your SSH server.
- 0Exit of the Cygwin shell.
- 1Install autossh as a Windows service.
- 0Now back in Windows, open a new command Window (Start → Run → cmd).
- 0cd C:\cygwin\bin
- 0cygrunsrv -I AutoSSH -p /usr/bin/autossh -a “-M 20000 -L localaddress:port:serveraddress:port user@ssh.host.name” -e AUTOSSH_NTSERVICE=yes
- 1Tweak Windows service settings.
- 0Open the Services management console (Administrative Tools → Services).
- 0Edit the properties of the AutoSSH service.
- 0In the “Log On” tab, select the “This account” radio button and set the service to run as your current user.
- 0Start the service.
- 1Test your tunnels.
- 2Consider making a scheduled task to start the service every hour or so, in case autossh goes boom.
⇨1 Comment⇦
Nice and useful manual, thank you. Especially for those who often use many proxies.
⇢Leave a Reply⇠
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Microsoft (R) Windows 98
(C)Copyright Microsoft Corp 1981-1998.
C:\>