当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : ssh如何chroot?
帖子发表于 : 2015-08-13 17:38 

注册: 2015-07-24 8:29
帖子: 111
系统: ubuntu
送出感谢: 0 次
接收感谢: 0 次
ssh test_ssh@192.168.1.104
test_ssh@192.168.1.104's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Could not chdir to home directory /home/test_ssh: No such file or directory
/bin/sh: No such file or directory
Connection to 192.168.1.104 closed.

配置文件
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
ChrootDirectory /sftp/test_ssh/

为何不能正常chroot 进入 /sftp/test_ssh目录呢,为何出来个 /home/test_ssh目录?


页首
 用户资料  
 
2 楼 
 文章标题 : Re: ssh如何chroot?
帖子发表于 : 2015-08-14 12:07 
头像

注册: 2007-05-06 8:19
帖子: 7446
送出感谢: 0 次
接收感谢: 5
这个不是谁登陆就到谁的“home”了?


页首
 用户资料  
 
3 楼 
 文章标题 : Re: ssh如何chroot?
帖子发表于 : 2015-08-14 13:59 

注册: 2009-08-04 16:33
帖子: 16886
送出感谢: 21
接收感谢: 1826
引用:
为何出来个 /home/test_ssh目录?

http://manpages.ubuntu.com/manpages/viv ... fig.5.html
sshd_config — OpenSSH SSH daemon configuration file
ChrootDirectory
After the chroot, sshd(8) changes the working directory to the user's home directory.


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

当前时区为 UTC + 8 小时


在线用户

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


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

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

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