<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "利用scponly限制帳號只能SCP或SFTP不能SSH登入"]]></title>
		<link>https://forum.andowson.com/posts/list/16.page</link>
		<description><![CDATA[Latest messages posted in the topic "利用scponly限制帳號只能SCP或SFTP不能SSH登入"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>利用scponly限制帳號只能SCP或SFTP不能SSH登入</title>
				<description><![CDATA[ 最近公司要求介面帳號不能SSH登入主機，由於有些介面帳號是用來備份網路設備的設定檔，而採用的檔案傳輸方式是SCP不是SFTP，故無法[url=http://www.andowson.com/posts/list/554.page]參考這篇[/url]透過修改/etc/ssh/sshd_config的Subsystem sftp internal-sftp方式來達成。 
<br>
<br>
搜尋了一下網路發現可以透故scponly這個套件來達成，首先可以透過下列網址安裝對應發行版本的epel套件 
<br>
http://dl.fedoraproject.org/pub/epel/ 
<br>
<br>
例如 
<br>
RHEL 6/CentOS 6 
<br>
[code]rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[/code] 
<br>
RHEL 5/CentOS 5 
<br>
[code]rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm[/code] 
<br>
<br>
然後再透過yum安裝scponly 
<br>
[code]yum install scponly[/code] 
<br>
<br>
安裝完成後將介面帳號的shell修改為/usr/bin/scponly，例如將user1的shell修改為scponly 
<br>
[code]usermod -s /usr/bin/scponly user1[/code] 
<br>
<br>
然後再利用WinSCP或FileZilla等工具程式確認是否可以正常SCP或SFTP 
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/639/1332.page</guid>
				<link>https://forum.andowson.com/posts/preList/639/1332.page</link>
				<pubDate><![CDATA[Sat, 22 Aug 2015 15:34:46]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>