<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Sftp</id>
		<title>Sftp - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Sftp"/>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sftp&amp;action=history"/>
		<updated>2026-04-30T15:24:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6121&amp;oldid=prev</id>
		<title>Christoph at 11:40, 20 September 2014</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6121&amp;oldid=prev"/>
				<updated>2014-09-20T11:40:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:40, 20 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol''' or '''SFTP'') is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is an extension of the [[SSH|Secure Shell protocol]] (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol''' or '''SFTP&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'') is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is an extension of the [[SSH|Secure Shell protocol]] (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SFTP chroot jail==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SFTP chroot jail==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6120&amp;oldid=prev</id>
		<title>Christoph at 11:40, 20 September 2014</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6120&amp;oldid=prev"/>
				<updated>2014-09-20T11:40:04Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:40, 20 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol'' or '''SFTP'') is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is an extension of the [[SSH|Secure Shell protocol]] (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' or '''SFTP'') is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is an extension of the [[SSH|Secure Shell protocol]] (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SFTP chroot jail==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SFTP chroot jail==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6119&amp;oldid=prev</id>
		<title>Christoph: New page: '''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol'' or '''SFTP'') is a network protocol that provides file access, file transfer, and file management functionalities ...</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sftp&amp;diff=6119&amp;oldid=prev"/>
				<updated>2014-09-20T11:39:48Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &amp;#039;&amp;#039;&amp;#039;SSH File Transfer Protocol&amp;#039;&amp;#039;&amp;#039; (also &amp;#039;&amp;#039;&amp;#039;Secure File Transfer Protocol&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;SFTP&amp;#039;&amp;#039;) is a network protocol that provides file access, file transfer, and file management functionalities ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''SSH File Transfer Protocol''' (also '''Secure File Transfer Protocol'' or '''SFTP'') is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is an extension of the [[SSH|Secure Shell protocol]] (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols.&lt;br /&gt;
&lt;br /&gt;
==SFTP chroot jail==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;&amp;lt;code&amp;gt;chroot&amp;lt;/code&amp;gt;&amp;quot; in [[Linux]] is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally not access) files outside the designated directory tree. The term &amp;quot;chroot&amp;quot; may refer to the &amp;lt;code&amp;gt;chroot(2)&amp;lt;/code&amp;gt; system call or the &amp;lt;code&amp;gt;chroot(8)&amp;lt;/code&amp;gt; wrapper program. The following is how one would setup a modified environment (a &amp;quot;chroot jail&amp;quot;) for a given directory that only allows a given user to access a specified directory (and only that directory, no other on the system).&lt;br /&gt;
&lt;br /&gt;
''NOTE: In the following example, there will be a user &amp;quot;&amp;lt;code&amp;gt;bob&amp;lt;/code&amp;gt;&amp;quot; who only has access to upload/download files from the &amp;lt;code&amp;gt;/var/www/jail/bob&amp;lt;/code&amp;gt; directory.''&lt;br /&gt;
&lt;br /&gt;
* Step#1: Add the following to the bottom of your &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
 Match user bob&lt;br /&gt;
     ChrootDirectory /var/www/jail/%u&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
 $ sudo service ssh restart&lt;br /&gt;
&lt;br /&gt;
* Step #2: Run the following commands (as root/sudo):&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p /var/www/jail/bob&lt;br /&gt;
 $ addgroup --system sftp-users&lt;br /&gt;
 $ useradd -m -s /bin/nologin -c &amp;quot;bob&amp;quot; -G sftp-users bob&lt;br /&gt;
 $ passwd bob  # set password for user &amp;quot;bob&amp;quot;&lt;br /&gt;
 $ chown root:root /home/&lt;br /&gt;
 $ chown root:root /home/bob/&lt;br /&gt;
 $ chmod 755 /home/bob&lt;br /&gt;
 $ mkdir -p /home/bob/data&lt;br /&gt;
 $ chown -Rv bob:sftp-users data&lt;br /&gt;
 $ chown -Rv bob:sftp-users /var/www/jail/bob/&lt;br /&gt;
 $ mount --bind /var/www/jail/bob/ /home/bob/data/&lt;br /&gt;
 $ cat /etc/mtab  # check that the following line exists&lt;br /&gt;
 /var/www/jail/bob /home/bob/data none rw,bind 0 0&lt;br /&gt;
 $ cp /etc/fstab{,.bak}  # backup your old fstab&lt;br /&gt;
 $ tail -1 /etc/mtab &amp;gt;&amp;gt;/etc/fstab&lt;br /&gt;
 $ echo &amp;quot;Testing bob's SFTP chroot jail&amp;quot; &amp;gt;/home/bob/data/README&lt;br /&gt;
 $ chown root /var/www/jail/bob&lt;br /&gt;
&lt;br /&gt;
* Step #3: Testing your setup (where &amp;quot;&amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;&amp;quot; is the IP address of the remote server):&lt;br /&gt;
&lt;br /&gt;
 $ sftp bob@x.x.x.x&lt;br /&gt;
 sftp&amp;gt; ls&lt;br /&gt;
 README&lt;br /&gt;
&lt;br /&gt;
If all goes as planned, user &amp;quot;bob&amp;quot; should be able to read/download the &amp;quot;&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt;&amp;quot; file and upload files to that &amp;lt;code&amp;gt;/var/www/jail/bob/&amp;lt;/code&amp;gt; directory (and that directory only).&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[SSH]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux Command Line Tools]]&lt;/div&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	</feed>