<?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>FettesPS &#187; ftp</title>
	<atom:link href="http://www.fettesps.com/tag/ftp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Sun, 22 Jan 2012 18:21:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Command Line SFTP with SCP</title>
		<link>http://www.fettesps.com/command-line-sftp-with-scp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=command-line-sftp-with-scp</link>
		<comments>http://www.fettesps.com/command-line-sftp-with-scp/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 12:00:34 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh2]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=803</guid>
		<description><![CDATA[If you&#8217;re making a batch file that requires you to upload some files over SFTP/SCP then you&#8217;ll need to use an external program such as WinSCP that has command line access to upload the files. Unfortunately you cannot use the native FTP client in Windows. First create a config file with your server settings and [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re making a batch file that requires you to upload some files over SFTP/SCP then you&#8217;ll need to use an external program such as WinSCP that has command line access to upload the files.  Unfortunately you cannot use the native FTP client in Windows. First create a config file with your server settings and save it in the same directory as your batch file. I also make use of an RSA key pair for added security, in this example that public key will be saved as key.ppk using PuTTY&#8217;s key format. </p>
<pre class="brush: bash; title: ; notranslate"># Automatically answer all prompts negatively not to stall
# the script on errors
option batch on

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect using a password
# open user:password@example.com
# Connect
open sftp://user:pass@ip:22 -hostkey=&quot;ssh-rsa 2048 ba:52:06:a7:7a:4a:17:1e:49:a9:ef:ae:08:5b:90:54&quot; -privatekey=&quot;key.ppk&quot;

# Change remote directory
cd /home/user/files

# Force binary mode transfer
option transfer binary

# Upload file to the server
put file2upload.jar

# Disconnect
close

# Exit WinSCP
exit</pre>
<p>Now in your batch file, after you&#8217;re done compiling or what ever it is you need to do first, add this line (making sure to replace the path for WinSCP with the one you&#8217;ve used on your system):</p>
<pre class="brush: bash; title: ; notranslate">
&quot;C:\Program Files (x86)\WinSCP\WinSCP.exe&quot; /console /script=sftp.scp
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/command-line-sftp-with-scp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Pure-FTPd on Ubuntu 9.04 Server</title>
		<link>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-904-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-pure-ftpd-on-ubuntu-904-server</link>
		<comments>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-904-server/#comments</comments>
		<pubDate>Sun, 31 May 2009 21:46:12 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[proftpd]]></category>
		<category><![CDATA[pureftpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=140</guid>
		<description><![CDATA[Although I no longer install FTP servers on any of my Linux servers, as I favour the user of SFTP, I wanted to update my instructions for the newest version of Ubuntu Server. I’m sure these instructions are very similar for most distributions, but I thought I’d specifically target Ubuntu 9.04 Server since that is what [...]]]></description>
			<content:encoded><![CDATA[<div><span>Although I no longer install FTP servers on any of my Linux servers, as I favour the user of SFTP, I wanted to update my instructions for the newest version of Ubuntu Server. I’m sure these instructions are very similar for most distributions, but I thought I’d specifically target Ubuntu 9.04 Server since that is what I am most familiar with.<br />
<code>sudo apt-get install pure-ftpd</code></p>
<p style="font-size: 1.05em;">When prompted, enter Y and hit enter.</p>
<p style="font-size: 1.05em;">Now, set up a new account using the &#8216;useradd&#8217; command. You&#8217;ll also need to specify the home directory for the user by adding &#8216;-d /home/directoryname -m&#8217; so when the user logs in they have a folder to upload/download files from.  You don&#8217;t have to use the <span style="font-style: italic;">/home</span> dirctory for this but I always do to make things simple.  Here is the command I used.</p>
<p><code>sudo useradd -d /home/username -m username<br />
sudo passwd username<br />
</code></p>
<p style="font-size: 1.05em;">Since I don&#8217;t want this user being able to cruise through the file system and see everything I&#8217;m going to lock the user to the home directory we just made. Open up<span> </span><em>/etc/passwd</em><span> </span>for editing. I use pico for this, you can use whatever program you like. Search for the user you just made (ctrl+w in pico) and add<span> </span><em>/./</em><span> </span>to their home directory like this:</p>
<p><code>sudo pico /etc/passwd<br />
/home/username/./</code></p>
<p style="font-size: 1.05em;">Note that the line will be a lot messier than that, so just squeeze it in where appropriate. Also, make sure to put in a shell at the end of that line…<span> </span><em>/bin/bash</em><span> </span>works fine. After all of that, add their username to<span> </span><em>/etc/ftpallow</em> if you want to manually allow access to certain accounts.</p>
<p>Now just type<span> </span><em>pure-ftpd-control restart</em><span> </span>on the command line and you&#8217;re ready to test out your account!  Hop on another computer, or just SSH into another one and try from there.  If it doesn&#8217;t work its possible your install didn&#8217;t set up some of the proper configuration.  This happens automatically on Ubuntu 9.04 Server but on other distrobutions you may need to perform this next step.</p>
<p style="font-size: 1.05em;">Edit<span> </span><em>/etc/pam.d/pure-ftpd</em><span> </span>using your favourite editor to look like this:</p>
<p><code>auth sufficient pam_ftp.soauth required pam_unix_auth.so shadow use_first_pass</code><br />
<code>auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed</code><br />
<code>auth required pam_listfile.so item=user sense=allow file=/etc/ftpallow onerr=fail</code><br />
<code>auth required pam_shells.so</code></p>
<p style="font-size: 1.05em;">Save the file, restart the server again and try it out again.  If you&#8217;re having troubles still I suggest seeking help from the <a href="http://www.pureftpd.org/project/pure-ftpd/doc" target="_new">Documentation</a>.</p>
<p></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-904-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Pure-FTPd on Ubuntu 8.04 Server</title>
		<link>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-804-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-pure-ftpd-on-ubuntu-804-server</link>
		<comments>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-804-server/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 05:02:15 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[pure-ftpd]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu 8.10]]></category>
		<category><![CDATA[ubuntu 9.04]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=10</guid>
		<description><![CDATA[Until recently my choice for an FTP server had always been ProFTPd, however I found its difficulty to install made it a constant chore every time I had to set up a server.  So I sought out an alternative that was quick and easy to install yet did not sacrifice functionality or security.  The answer [...]]]></description>
			<content:encoded><![CDATA[<div><span></p>
<p style="font-size: 1.05em;">Until recently my choice for an FTP server had always been ProFTPd, however I found its difficulty to install made it a constant chore every time I had to set up a server.  So I sought out an alternative that was quick and easy to install yet did not sacrifice functionality or security.  The answer was Pure-FTPd.</p>
<p style="font-size: 1.05em;">I’m sure these instructions are very similar for most distributions, but I thought I’d specifically target Ubuntu 8.04 Server since that is what I am installing it on today. If you are using the desktop edition of Ubuntu or another distrobution that has a GUI you can most likely use that alternative.  Instead of apt-get commands you would simply fire up the Synaptic Package Manager and search for the install package.</p>
<p style="font-size: 1.05em;">I tend to jump right to the super user when I log in (bad habit, I know).  So if you&#8217;re not doing that you will have to prefix all commands with &#8216;sudo&#8217; or they might not work. Start off by installing the program and all of its required packages.</p>
<pre class="brush: bash; title: ; notranslate">apt-get install pure-ftpd</pre>
<p style="font-size: 1.05em;">When prompted, enter Y and hit enter.</p>
<p style="font-size: 1.05em;">Now, set up a new account using the &#8216;useradd&#8217; command. You&#8217;ll also need to specify the home directory for the user by adding &#8216;-d /home/directoryname -m&#8217; so when the user logs in they have a folder to upload/download files from.  You don&#8217;t have to use the <span style="font-style: italic;">/home</span> dirctory for this but I always do to make things simple.  Here is the command I used.</p>
<pre class="brush: bash; title: ; notranslate">useradd -d /home/username -m username
passwd username</pre>
<p style="font-size: 1.05em;">Since I don&#8217;t want this user being able to cruise through the file system and see everything I&#8217;m going to lock the user to the home directory we just made. Open up<span> </span><em>/etc/passwd</em><span> </span>for editing. I use pico for this, you can use whatever program you like. Search for the user you just made (ctrl+w in pico) and add<span> </span><em>/./</em><span> </span>to their home directory like this:</p>
<pre class="brush: bash; title: ; notranslate">/home/username/./</pre>
<p style="font-size: 1.05em;">Note that the line will be a lot messier than that, so just squeeze it in where appropriate.</p>
<p style="font-size: 1.05em;">Also, make sure to put in a shell at the end of that line…<span> </span><em>/bin/bash</em><span> </span>works fine. After all of that, add their username to<span> </span><em>/etc/ftpallow</em> if you want to manually allow access to certain accounts.</p>
<p>Now just type<span> </span><em>pure-ftpd-control restart</em><span> </span>on the command line and you&#8217;re ready to test out your account!  Hop on another computer, or just SSH into another one and try from there.  If it doesn&#8217;t work its possible your install didn&#8217;t set up some of the proper configuration.  This happens automatically on Ubuntu 8.04 Server but on other distrobutions you may need to perform this next step.</p>
<p style="font-size: 1.05em;">Edit<span> </span><em>/etc/pam.d/pure-ftpd</em><span> </span>using your favourite editor to look like this:</p>
<pre class="brush: bash; title: ; notranslate">auth sufficient pam_ftp.so
auth required pam_unix_auth.so shadow use_first_pass
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_listfile.so item=user sense=allow file=/etc/ftpallow onerr=fail
auth required pam_shells.so</pre>
<p style="font-size: 1.05em;">Save the file, restart the server again and try it out again.  If you&#8217;re having troubles still I suggest seeking help from the <a href="http://www.pureftpd.org/project/pure-ftpd/doc" target="_new">Documentation</a>.</p>
<p></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/installing-pure-ftpd-on-ubuntu-804-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

