当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 5 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 能否如此限定 ssh?
帖子发表于 : 2017-03-07 9:46 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
要 root 只能从 eth1 登录,但其余帐户可从 eth0 登录。


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 能否如此限定 ssh?
帖子发表于 : 2017-03-07 11:13 

注册: 2009-08-04 16:33
帖子: 16899
送出感谢: 21
接收感谢: 1829
引用:
要 root 只能从 eth1 登录,但其余帐户可从 eth0 登录。

可以把這些條件寫在 SSH Server 端的 authorized_keys
細節參閱
http://man.he.net/man5/authorized_keys
added to the per-user file


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 能否如此限定 ssh?
帖子发表于 : 2017-03-07 11:25 
头像

注册: 2010-04-10 16:14
帖子: 2903
系统: Arch Linux
送出感谢: 8
接收感谢: 69
比较简单的做法是,起两个进程,用两份配置吧……


_________________
dz,U,EIS. cies.
dz-cies@github
小香猪杀手@cc98.org


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 能否如此限定 ssh?
帖子发表于 : 2017-03-07 20:54 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
引用:
AllowUsers
This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for user names that match one of the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USER@HOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allow/deny directives are processed in the following order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups.

See PATTERNS in ssh_config(5) for more information on patterns.

懂洋文真好,机器翻译还是不行


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
5 楼 
 文章标题 : Re: 能否如此限定 ssh?
帖子发表于 : 2017-03-08 10:29 

注册: 2009-08-04 16:33
帖子: 16899
送出感谢: 21
接收感谢: 1829
提供一個例子
http://troy.jdmz.net/rsnapshot/
寫在 authorized_keys
Restricting The Key :
引用:
from="10.1.1.1",command="/home/remoteuser/cron/validate-rsync" ssh-dss AAAAB3Nza
... 中間省略
j2yBgN5cy8arlZ80q1Mcy763RjYGkR/FkLJ611HWIA= root@localhost.example.com

1. from="10.1.1.1" 只限 從 10.1.1.1 連線
2. /home/remoteuser/cron/validate-rsync 連線後先執行這個檔案
3. 限於使用者 root@localhost.example.com


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 5 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译