<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Libre Things &#187; SSH</title>
	<atom:link href="http://positon.org/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://positon.org</link>
	<description></description>
	<lastBuildDate>Tue, 23 Feb 2016 20:01:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.7.1</generator>
	<item>
		<title>Disable SSH askpass in git push</title>
		<link>http://positon.org/disable-ssh-askpass-in-git-push</link>
		<comments>http://positon.org/disable-ssh-askpass-in-git-push#comments</comments>
		<pubDate>Sun, 27 Apr 2014 12:24:37 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org/?p=178</guid>
		<description><![CDATA[If you have the problem when pushing to github for example. You can just empty the core.askpass param: git config --global core.askpass '' See also man git config]]></description>
				<content:encoded><![CDATA[<p>If you have the problem when pushing to <a href="http://github.com" title="github">github</a> for example.</p>
<p>You can just empty the core.askpass param:</p>
<pre>
git config --global core.askpass ''
</pre>
<p>See also <code>man git config</code></p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/disable-ssh-askpass-in-git-push/feed</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
		<item>
		<title>Bsync: Bidirectional Synchronization using Rsync</title>
		<link>http://positon.org/bsync-bidirectional-synchronization-using-rsync</link>
		<comments>http://positon.org/bsync-bidirectional-synchronization-using-rsync#comments</comments>
		<pubDate>Thu, 05 Dec 2013 22:22:36 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bsync]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://fr.positon.org/?p=152</guid>
		<description><![CDATA[Bsync is a bidirectional file synchronization tool, using rsync for transfers. Moved files are also synchronized in a smart way. It uses rsync for file transfers, find to generate filelist snapshots, and ssh for remote transfers. bsync is an alternative to Unison, written in Python 3. A big strength of bsync: it can detect and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Bsync is a bidirectional file synchronization tool, using rsync for transfers. <strong>Moved files</strong> are also synchronized in a smart way.</p>
<p>It uses <a href="http://rsync.samba.org">rsync</a> for file transfers, <a href="http://www.gnu.org/software/findutils/">find</a> to generate filelist snapshots, and <a href="http://www.openssh.com/">ssh</a> for remote transfers.</p>
<p>bsync is an alternative to Unison, written in <a href="http://www.python.org/">Python 3</a>. A big strength of bsync: it can detect and apply moved files from one side to the other (Unison uses some copy calls to handle moved files).</p>
<p>I developped it to be able to synchronize my music directory from my laptop to my <a href="http://www.raspberrypi.org/">Raspberry Pi</a> in an efficient way, and to sync with my girlfriend laptop too.</p>
<p>Bsync is released under GPL. Feel free to report any bugs/wishes in <a href="https://github.com/dooblem/bsync/issues">GitHub issues</a>.</p>
<p><a href="https://github.com/dooblem/bsync">More info, Download and Install on the GitHub repo.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/bsync-bidirectional-synchronization-using-rsync/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>ssh-agent: automatic ssh-add on demand</title>
		<link>http://positon.org/ssh-agent-automatic-ssh-add-on-demand</link>
		<comments>http://positon.org/ssh-agent-automatic-ssh-add-on-demand#comments</comments>
		<pubDate>Sat, 08 Sep 2012 22:40:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=118</guid>
		<description><![CDATA[Several desktop environments (Gnome, KDE) automatically start an SSH agent at startup. However, you have to think of running ssh-add before connecting to a server. Waiting for automatic ssh-add in OpenSSH, you can add this to your .bashrc: ssh-add -l &#62;/dev/null &#124;&#124; alias ssh='ssh-add -l &#62;/dev/null &#124;&#124; ssh-add &#38;&#38; unalias ssh; ssh' The alias is [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Several desktop environments (Gnome, KDE) automatically start an SSH agent at startup. However, you have to think of running ssh-add before connecting to a server.</p>
<p>Waiting for automatic ssh-add in OpenSSH, you can add this to your <code>.bashrc</code>:</p>
<pre>
ssh-add -l &gt;/dev/null || alias ssh='ssh-add -l &gt;/dev/null || ssh-add &amp;&amp; unalias ssh; ssh'
</pre>
<p>The alias is created only if the identity is not added, and the alias destroys itself once run.</p>
<p>This way the regular ssh command is used after the identity has been added.</p>
<p><a href="http://superuser.com/questions/325662/how-to-make-ssh-agent-automatically-add-the-key-on-demand/471640#471640" title="http://superuser.com/questions/325662/how-to-make-ssh-agent-automatically-add-the-key-on-demand/471640#471640">http://superuser.com/questions/325662/how-to-make-ssh-agent-automatically-add-the-key-on-demand/471640#471640</a></p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/ssh-agent-automatic-ssh-add-on-demand/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rsync command restriction over SSH</title>
		<link>http://positon.org/rsync-command-restriction-over-ssh</link>
		<comments>http://positon.org/rsync-command-restriction-over-ssh#comments</comments>
		<pubDate>Wed, 29 Dec 2010 17:36:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=108</guid>
		<description><![CDATA[You have 2 systems and you want to set up a secure backup with rsync + SSH of one system to the other. Very simply, you can use: backup.example.com# rsync -avz --numeric-ids --delete root@myserver.example.com:/path/ /backup/myserver/ To do the backup, you have to be root on the remote server, because some files are only root readable. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>You have 2 systems and you want to set up a secure backup with rsync + SSH of one system to the other.</p>
<p>Very simply, you can use:</p>
<pre>
backup.example.com# rsync -avz --numeric-ids --delete root@myserver.example.com:/path/ /backup/myserver/
</pre>
<p>To do the backup, you have to be root on the remote server, because some files are only root readable.</p>
<p>Problem: you will allow backup.example.com to do anything on myserver.example.com, where just read only access on the directory is sufficient.</p>
<p>To solve it, you can use the <code>command=""</code> directive in the <code>authorized_keys</code> file to filter the command.</p>
<p>To find this command, start rsync adding the <code>-e'ssh -v'</code> option:</p>
<pre>
rsync -avz -e'ssh -v' --numeric-ids --delete root@myserver.example.com:/path/ /backup/myserver/ 2&gt;&amp;1 | grep &quot;Sending command&quot;
</pre>
<p>You get a result like:</p>
<pre>
debug1: Sending command: rsync --server --sender -vlogDtprze.iLsf --numeric-ids . /path/
</pre>
<p>Now, just add the command before the key in <code>/root/.ssh/authorized_keys</code>:</p>
<pre>
command=&quot;rsync --server --sender -vlogDtprze.iLsf --numeric-ids . /path/&quot; ssh-rsa AAAAB3NzaC1in2EAAAABIwAAABio......
</pre>
<p>And for even more security, you can add an IP filter, and other options:</p>
<pre>
from=&quot;backup.example.com&quot;,command=&quot;rsync --server --sender -vlogDtprze.iLsf --numeric-ids . /path/&quot;,no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa AAAAB3NzaC1in2EAAAABIwAAABio......
</pre>
<p>Now try to open a ssh shell on the remote server.. and try some unauthorized rsync commands&#8230;</p>
<p>Notes:</p>
<ul>
<li>Beware that if you change rsync command options, change also the <code>authorized_keys</code> file.</li>
<li>No need for complex chroot anymore. Forget my previous article: <a href="/sftp-chroot-rsync">sftp-chroot-rsync</a></li>
</ul>
<p><ins>See also</ins>:</p>
<ul>
<li><code>man ssh #/AUTHORIZED_KEYS FILE FORMAT</code></li>
<li><code>man rsync</code></li>
<li><code>view /usr/share/doc/rsync/scripts/rrsync.gz</code> (restricted rsync, allows you to manage allowed options precisely)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/rsync-command-restriction-over-ssh/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Reverse SSH Tunnel for SSH connection to a NATed machine</title>
		<link>http://positon.org/reverse-ssh-tunnel-for-ssh-connection-to-a-nated-machine</link>
		<comments>http://positon.org/reverse-ssh-tunnel-for-ssh-connection-to-a-nated-machine#comments</comments>
		<pubDate>Sun, 20 Jun 2010 22:48:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=98</guid>
		<description><![CDATA[This is how to open a SSH connexion to a serveur hidden behind a NAT gateway. We use a reverse SSH tunnel: nated-host$ ssh -R 2222:localhost:22 anyuser@public-host anyuser@public-host$ This command opens 2222 port on public-host, forwarding it to local 22 port on nated-host. Finally, from public-host we connect to 2222 local port with SSH, to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is how to open a SSH connexion to a serveur hidden behind a NAT gateway.</p>
<p>We use a reverse SSH tunnel:</p>
<pre>
nated-host$ ssh -R 2222:localhost:22 anyuser@public-host
anyuser@public-host$
</pre>
<p>This command opens 2222 port on <code>public-host</code>, forwarding it to local 22 port on <code>nated-host</code>.</p>
<p>Finally, from <code>public-host</code> we connect to 2222 local port with SSH, to end on <code>nated-host</code>:</p>
<pre>
public-host$ ssh -p2222 localhost
nated-host$
</pre>
<p><ins>References</ins>:</p>
<ul>
<li><code>man ssh</code></li>
<li><a href="http://articles.techrepublic.com.com/5100-10878_11-5779944.html?tag=nl.e011" title="http://articles.techrepublic.com.com/5100-10878_11-5779944.html?tag=nl.e011">http://articles.techrepublic.com.com/5100-10878_11-5779944.html?tag=nl.e011</a></li>
<li><a href="http://www.howtoforge.com/reverse-ssh-tunneling" title="http://www.howtoforge.com/reverse-ssh-tunneling">http://www.howtoforge.com/reverse-ssh-tunneling</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/reverse-ssh-tunnel-for-ssh-connection-to-a-nated-machine/feed</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
		<item>
		<title>[SSH] Change directory while connecting</title>
		<link>http://positon.org/ssh-change-directory-while-connecting</link>
		<comments>http://positon.org/ssh-change-directory-while-connecting#comments</comments>
		<pubDate>Thu, 10 Dec 2009 20:09:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=73</guid>
		<description><![CDATA[Problem: I want to create a server-www alias that connects me to the SSH server and change the directory to /var/www/ right after the connection. There it is : ssh -t server 'cd /var/www &#38;&#38; $SHELL' And for the alias, add this in your ~/.bashrc: alias server-www=&#34;ssh -t server 'cd /var/www &#38;&#38; $SHELL'&#34; server-www # [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Problem:</p>
<p>I want to create a <code>server-www</code> alias that connects me to the SSH server and change the directory to <code>/var/www/</code> right after the connection.</p>
<p>There it is :</p>
<pre>
ssh -t server 'cd /var/www &amp;&amp; $SHELL'
</pre>
<p>And for the alias, add this in your <code>~/.bashrc</code>:</p>
<pre>
alias server-www=&quot;ssh -t server 'cd /var/www &amp;&amp; $SHELL'&quot;
server-www # test it !
</pre>
<p><ins>References</ins> :</p>
<ul>
<li><a href="http://groups.google.com/group/comp.security.ssh/browse_thread/thread/ab8981e1c8df2929" title="http://groups.google.com/group/comp.security.ssh/browse_thread/thread/ab8981e1c8df2929">http://groups.google.com/group/comp.security.ssh/browse_thread/thread/ab8981e1c8df2929</a></li>
<li><a href="http://ubuntuforums.org/archive/index.php/t-395113.html" title="http://ubuntuforums.org/archive/index.php/t-395113.html">http://ubuntuforums.org/archive/index.php/t-395113.html</a></li>
<li><code>man ssh</code></li>
<li><code>ssh -t server set</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/ssh-change-directory-while-connecting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SFTP chroot + rsync</title>
		<link>http://positon.org/sftp-chroot-rsync</link>
		<comments>http://positon.org/sftp-chroot-rsync#comments</comments>
		<pubDate>Fri, 09 Oct 2009 16:12:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=62</guid>
		<description><![CDATA[Here is howto make sftp shares with chroot. In /etc/ssh/sshd_config: # we use openssh internal sftp # because /usr/lib/openssh/sftp-server won't be available in chroot Subsystem sftp internal-sftp Match group sftp ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp UPDATE 17/06/2010: Beware with the syntax! Comments must start at the line beginning, and no spaces at [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Here is howto make sftp shares with chroot.</p>
<p>In <code>/etc/ssh/sshd_config</code>:</p>
<pre>
# we use openssh internal sftp
# because /usr/lib/openssh/sftp-server won't be available in chroot
Subsystem sftp internal-sftp

Match group sftp
        ChrootDirectory %h
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp
</pre>
<p><strong>UPDATE 17/06/2010:</strong> Beware with the syntax! Comments must start at the line beginning, and no spaces at the end of the <code>ForceCommand internal-sftp</code> line.</p>
<p>Now just create users belonging to sftp group, and that&#8217;s it.<br />
Test it with:</p>
<pre>
sftp user@myserver.com
</pre>
<p><strong>Problem: we cannot use the rsync command to send files</strong>, because rsync is not available in the chroot.</p>
<p>First, we allow other commands, commenting the line:</p>
<pre>
#ForceCommand internal-sftp
</pre>
<p>Then, we build the following tree in the chroot directory:</p>
<pre>
bin/
bin/bash
bin/rsync
lib/
lib/libncurses.so.5
lib/ld-linux.so.2
lib/libacl.so.1
lib/libpopt.so.0
lib/libattr.so.1
lib/i686
lib/i686/cmov
lib/i686/cmov/libdl.so.2
lib/i686/cmov/libc.so.6
</pre>
<p>We must put both <code>bash</code> and <code>rsync</code> commands, and all their librairies (you can display them with the <code>ldd</code> command).</p>
<p>Note: the user must have <code>/bin/bash</code> as default shell.</p>
<p>Note2: the chroot dir must belong to root, even if it&#8217;s the user&#8217;s folder. To allow the user to write in it, you have to create a subfolder with appropriate permissions. According to OpenSSH programers, it&#8217;s a big constraint, but very important for a chroot&#8217;s security.</p>
<p><ins>References</ins> :</p>
<ul>
<li><code>man sshd_config</code></li>
<li><a href="http://www.debian-administration.org/articles/590" title="http://www.debian-administration.org/articles/590">http://www.debian-administration.org/articles/590</a></li>
<li><a href="http://www.howtoforge.org/chrooted-ssh-sftp-tutorial-debian-lenny" title="http://www.howtoforge.org/chrooted-ssh-sftp-tutorial-debian-lenny">http://www.howtoforge.org/chrooted-ssh-sftp-tutorial-debian-lenny</a></li>
<li><a href="http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/" title="http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/">http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/sftp-chroot-rsync/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fail2ban</title>
		<link>http://positon.org/fail2ban</link>
		<comments>http://positon.org/fail2ban#comments</comments>
		<pubDate>Mon, 03 Aug 2009 13:20:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=58</guid>
		<description><![CDATA[If you discover lots of ssh connection tries in your /var/log/auth.log (bots testing users/passwords), you have to do something. The simpler is to use an IP restriction rule in your iptables firewall, or in /etc/hosts.deny If you don&#8217;t want or can&#8217;t use this restriction, use Fail2ban: aptitude install fail2ban The default install blocks SSH connection [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you discover lots of ssh connection tries in your <code>/var/log/auth.log</code> (bots testing users/passwords), you have to do something.</p>
<p>The simpler is to use an IP restriction rule in your iptables firewall, or in <code>/etc/hosts.deny</code></p>
<p>If you don&#8217;t want or can&#8217;t use this restriction, use <strong>Fail2ban</strong>:</p>
<pre>
aptitude install fail2ban
</pre>
<p>The default install blocks SSH connection tries.</p>
<p>You can tune the config a bit or activate Fail2ban for other services. Example:</p>
<pre>
vi /etc/fail2ban/jail.conf
bantime  = 86400
maxretry = 10 # pour ssh
enabled  = true # pour vsftpd
maxretry = 10 # pour vsftpd
</pre>
<p>Then, the <code>iptables -L</code> command gives you all banned IP addresses.</p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/fail2ban/feed</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
		<item>
		<title>(Français) Afficher l&#8217;empreinte SSH d&#8217;un système</title>
		<link>http://positon.org/afficher-lempreinte-ssh-dun-systeme</link>
		<comments>http://positon.org/afficher-lempreinte-ssh-dun-systeme#comments</comments>
		<pubDate>Tue, 12 Aug 2008 08:41:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=36</guid>
		<description><![CDATA[Sorry, this entry is only available in Français.]]></description>
				<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://fr.positon.org/tag/ssh/feed">Français</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/afficher-lempreinte-ssh-dun-systeme/feed</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
	</channel>
</rss>
