<?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>Pario TechnoBlob &#187; sftp</title>
	<atom:link href="http://pario.no/tag/sftp/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HowTo use lftp as a sftp client</title>
		<link>http://pario.no/2009/06/23/howto-use-lftp-as-a-sftp-client/</link>
		<comments>http://pario.no/2009/06/23/howto-use-lftp-as-a-sftp-client/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 14:30:14 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1153</guid>
		<description><![CDATA[lftp is a file transfer program that allows sophisticated ftp, http and other connections to other hosts. If site is specified then lftp will connect to that site otherwise a connection has to be established with the open command. Basic usage lftp sftp://[domain name] lftp sftp://example.com Use a different user name than the one you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>lftp</strong>  is  a file transfer program that allows sophisticated ftp, http and other connections to other hosts. If site is specified then <strong>lftp</strong> will connect to that site otherwise a connection has to be established with the open command.</p>
<p><strong>Basic usage</strong></p>
<ul>
<li>lftp sftp://[domain name]</li>
<li>lftp sftp://example.com</li>
</ul>
<p><strong>Use a different user name than the one you are currently using</strong></p>
<ul>
<li>lftp sftp://[user name]@[domain name]</li>
<li>lftp sftp://username@example.com</li>
</ul>
<p><strong>Use a different port and different user name</strong></p>
<ul>
<li>lftp sftp://[user name]@[domain name]:[port number]</li>
<li>lftp sftp://userName@example.com:2222</li>
</ul>
<p><strong>Recursive download/upload</strong></p>
<pre>lftp> mirror directory_to_download
lftp> mirror -R directory_to_upload</pre>
<p>For more lftp options type the following command in a console window</p>
<pre>
# man lftp</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDYvMjMvaG93dG8tdXNlLWxmdHAtYXMtYS1zZnRwLWNsaWVudC88d3B0Yj5Ib3dUbyB1c2UgbGZ0cCBhcyBhIHNmdHAgY2xpZW50PHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/06/23/howto-use-lftp-as-a-sftp-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cold backup for the Open Source Edition of Zimbra</title>
		<link>http://pario.no/2008/02/01/cold-backup-for-the-open-source-edition-of-zimbra/</link>
		<comments>http://pario.no/2008/02/01/cold-backup-for-the-open-source-edition-of-zimbra/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 22:56:31 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[tar.]]></category>
		<category><![CDATA[Zimbra]]></category>

		<guid isPermaLink="false">http://pario.no/2008/02/01/cold-backup-for-the-open-source-edition-of-zimbra/</guid>
		<description><![CDATA[Today I&#8217;ve setup a cold backup routine to backup my Zimba installation running on my Debian (Etch) 4.0 server that is in full production now for my private domains. This is a slightly modified backup script for the Open Source Edition of Zimbra from the Zimbra Wiki. Please note that the script does a full [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve setup a cold backup routine to backup my Zimba installation running on my Debian (Etch) 4.0 server that is in full production now for my private domains. This is a slightly modified backup script for the Open Source Edition of Zimbra from the <a href="http://wiki.zimbra.com/index.php?title=Open_Source_Edition_Backup_Procedure#A_Simple_Shell_Script_Method">Zimbra Wiki</a>. Please note that the script does a full backup every time it&#8217;s being run!</p>
<pre>
#!/bin/bash

# Zimbra Backup Script
# Requires sftp to run
# This script is intended to run from the crontab as root
# Free to use and free of any warranty!  Daniel W. Martin, 9 Sept 2007

# Live sync before stopping Zimbra to minimize sync time with the services down
# Comment out the following line if you want to try single cold-sync only
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# which is the same as: /opt/zimbra /backup
# Including --delete option gets rid of files in the dest folder that don't exist at the src
# this prevents logfile/extraneous bloat from building up overtime.

# Stop Zimbra Services
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
sleep 40

# Sync to backup directory
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# Restart Zimbra Services
sudo -u zimbra /opt/zimbra/bin/zmcontrol start

# Create a txt file in the backup directory that'll contain the current Zimbra
# server version. Handy for knowing what version of Zimbra a backup can be restored to.
sudo -u zimbra zmcontrol -v &gt; /backup/zimbra/conf/zimbra_version.txt
# or examine your /opt/zimbra/.install_history

# Create archive of backed-up directory for offsite transfer
# cd /backup/zimbra
ZimbraVersion=zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914

tar -zcf /backup/$ZimbraVersion-$(date +"%Y-%m-%d").tgz -C /backup/zimbra .

# Transfer file to backup server using passwordless sftp
scp zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914-$(date +"%Y-%m-%d").tgz username@example.com:/path/to/backupfolder/</pre>
<p>I&#8217;ve described <a href="http://pario.no/2008/01/09/ssh-without-a-password/">passwordless ssh/sftp session</a> in a earlier post so I won&#8217;t describe the last line of the backup script.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/wiki.zimbra.com\/index.php?title=Open_Source_Edition_Backup_Procedure#A_Simple_Shell_Script_Method"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDIvMDEvY29sZC1iYWNrdXAtZm9yLXRoZS1vcGVuLXNvdXJjZS1lZGl0aW9uLW9mLXppbWJyYS88d3B0Yj5Db2xkIGJhY2t1cCBmb3IgdGhlIE9wZW4gU291cmNlIEVkaXRpb24gb2YgWmltYnJhPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/02/01/cold-backup-for-the-open-source-edition-of-zimbra/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SFTP in batch mode</title>
		<link>http://pario.no/2008/01/09/sftp-in-batch-mode/</link>
		<comments>http://pario.no/2008/01/09/sftp-in-batch-mode/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 15:03:13 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://pario.no/2008/01/09/sftp-in-batch-mode/</guid>
		<description><![CDATA[This post describes how you use sftp in batch mode. If you don&#8217;t want to type in your password read my SSH without a password post. Create a file named myCommands.sftp that contains the commands you want to run. My file looks like this # Change to your desired directory locally lcd /data/Hattori # Change [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes how you use <strong>sftp</strong> in batch mode. If you don&#8217;t want to type in your password read my <a href="http://pario.no/2008/01/09/ssh-without-a-password/">SSH without a password post</a>.</p>
<p>Create a file named myCommands.sftp that contains the commands you want to run. My file looks like this</p>
<pre>
# Change to your desired directory locally
lcd /data/Hattori
# Change to the desired directory on the remote server
cd /backup
# Transfer all remote files locally
get *
# We're done with this session
bye</pre>
<p>Next you run the sftp session</p>
<pre>
sftp -b myCommands.sftp example.com</pre>
<p>That should be all that is necessary to download your files from the remote server.</p>
<p>This example could easily have been extended with a crontab entry.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDEvMDkvc2Z0cC1pbi1iYXRjaC1tb2RlLzx3cHRiPlNGVFAgaW4gYmF0Y2ggbW9kZTx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/01/09/sftp-in-batch-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deny SSH- but allow SFTP access</title>
		<link>http://pario.no/2007/11/28/deny-ssh-but-allow-sftp-access/</link>
		<comments>http://pario.no/2007/11/28/deny-ssh-but-allow-sftp-access/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 23:31:22 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/28/deny-ssh-but-allow-sftp-access/</guid>
		<description><![CDATA[This is an alternative way of limiting the SSH access to only SFTP explained in my How to restrict users to SFTP only instead of SSH post. Edit your /etc/sshd_config file and change your settings like this Match User username AllowTcpForwarding no X11Forwarding no ForceCommand /usr/libexec/sftp-server -l INFO Replace username with the user name you [...]]]></description>
			<content:encoded><![CDATA[<p>This is an alternative way of limiting the SSH access to only SFTP explained in my <a href="http://pario.no/2007/04/30/how-to-restrict-users-to-sftp-only-instead-of-ssh/">How to restrict users to SFTP only instead of SSH</a> post.</p>
<p>Edit your <strong>/etc/sshd_config</strong> file and change your settings like this<br />
<code><br />
Match User username<br />
AllowTcpForwarding no<br />
X11Forwarding no<br />
ForceCommand /usr/libexec/sftp-server -l INFO </code></p>
<p>Replace username with the user name you would limit the SSH access for.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMjgvZGVueS1zc2gtYnV0LWFsbG93LXNmdHAtYWNjZXNzLzx3cHRiPkRlbnkgU1NILSBidXQgYWxsb3cgU0ZUUCBhY2Nlc3M8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/28/deny-ssh-but-allow-sftp-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to restrict users to SFTP only instead of SSH</title>
		<link>http://pario.no/2007/04/30/how-to-restrict-users-to-sftp-only-instead-of-ssh/</link>
		<comments>http://pario.no/2007/04/30/how-to-restrict-users-to-sftp-only-instead-of-ssh/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 11:36:36 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[usermod]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/04/30/how-to-restrict-users-to-sftp-only-instead-of-ssh/</guid>
		<description><![CDATA[Sometimes you want to have users, that have access to files on your server, but don&#8217;t want them to be able to log in and execute commands on your server. This is done quite easily. Add user as usually and assign him a password. Then run the following command (replace the &#8216;username&#8217; with real user [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to have users, that have access to files on your server, but don&#8217;t want them to be able to log in and execute commands on your server.<br />
<span id="more-165"></span><br />
This is done quite easily.</p>
<p>Add user as usually and assign him a password. Then run the following command (replace the &#8216;username&#8217; with real user name):</p>
<p><code>root@host # usermod -s /usr/lib/sftp-server username</code></p>
<p>This changes user&#8217;s shell to sftp-server.</p>
<p>The last step for this to work is to add &#8216;<strong>/usr/lib/sftp-server</strong>&#8216; to <strong>/etc/shells</strong> to make it a valid shell, eg. like this:</p>
<p><code>root@host # echo '/usr/lib/stfp-server' &gt;&gt; /etc/shells</code></p>
<p>There. Now you&#8217;ve setup a user who can only access your server with SFTP.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDQvMzAvaG93LXRvLXJlc3RyaWN0LXVzZXJzLXRvLXNmdHAtb25seS1pbnN0ZWFkLW9mLXNzaC88d3B0Yj5Ib3cgdG8gcmVzdHJpY3QgdXNlcnMgdG8gU0ZUUCBvbmx5IGluc3RlYWQgb2YgU1NIPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/04/30/how-to-restrict-users-to-sftp-only-instead-of-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

