<?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>深度VPS &#187; proxy</title>
	<atom:link href="http://www.deepvps.com/tag/proxy/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>开只允许用来代理上网的SSH账号的方法</title>
		<link>http://www.deepvps.com/ssh-account.html</link>
		<comments>http://www.deepvps.com/ssh-account.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 10:32:17 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=4</guid>
		<description><![CDATA[这个方法的副作用就是只有root才能使用sftp！
创建用户组，创建用户，设置密码：

groupadd SSHTunnel
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel TunnelUser1
passwd TunnelUser1


设置sftp权限：

chmod 700 /usr/lib/openssh/sftp-server

在/etc/ssh/sshd_config内添加：

Match Group SSHTunnel
AllowTcpForwarding yes
ForceCommand sh /home/tunnel/tunnelshell.sh

下载设置登陆脚本：

wget https://chencp.info/tunnelshell.sh --no-check-certificate - O /home/tunnel/tunnelshell.sh
ln -s  /home/tunnel/tunnelshell.sh  /home/tunnel/.profile

最后重启sshd：

/etc/init.d/ssh restart

这样就可以了，同时用户登陆后还支持passwd命令修改密码。
再添加用户则：

useradd -g SSHTunnel -s /bin/bash -d /home/tunnel &#38;lt;用户名&#38;gt;
passwd &#38;lt;用户名&#38;gt;

]]></description>
			<content:encoded><![CDATA[<p>这个方法的副作用就是只有root才能使用sftp！</p>
<p>创建用户组，创建用户，设置密码：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">groupadd SSHTunnel
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel TunnelUser1
passwd TunnelUser1</pre></div></div>

<p><span id="more-4"></span></p>
<p>设置sftp权限：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">chmod 700 /usr/lib/openssh/sftp-server</pre></div></div>

<p>在/etc/ssh/sshd_config内添加：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Match Group SSHTunnel
AllowTcpForwarding yes
ForceCommand sh /home/tunnel/tunnelshell.sh</pre></div></div>

<p>下载设置登陆脚本：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">wget https://chencp.info/tunnelshell.sh --no-check-certificate - O /home/tunnel/tunnelshell.sh
ln -s  /home/tunnel/tunnelshell.sh  /home/tunnel/.profile</pre></div></div>

<p>最后重启sshd：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">/etc/init.d/ssh restart</pre></div></div>

<p>这样就可以了，同时用户登陆后还支持passwd命令修改密码。</p>
<p>再添加用户则：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">useradd -g SSHTunnel -s /bin/bash -d /home/tunnel &amp;lt;用户名&amp;gt;
passwd &amp;lt;用户名&amp;gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/ssh-account.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
