Articles of chroot

在debian服务器上设置一个chroot sftp

我试图让用户“用户”通过sftp或ssh访问我的服务器。 我想用chroot将它们监控到一个目录中。 我阅读这里的说明,但它不起作用。 我做了以下几点: useradd用户 修改/ etc / ssh / sshd_config并添加 Match User user ForceCommand internal-sftp ChrootDirectory /home/duke/aa/smart到文件底部 将子系统行更改为Subsystem sftp internal-sftp 用/etc/init.d/ssh restart启动sshd 使用PuTTY作为用户“user”以ssh身份login Putty说“服务器意外closures连接”。 这是为什么呢?如何解决? 编辑 遵循下面的build议,我已经使sshd_config的底部看起来像: Match User user ChrootDirectory /tmp 但没有变化。 我确实得到一个密码确定,但我不能通过SSH连接,也不能通过SFTP连接。 是什么赋予了?

nginx的+ PHP-FPM(chroot环境)。 没有指定input文件

OS:Centos PHP:5.5.6 Nginx:1.4.4 Nginx conf server { listen 80; server_name example.ltd; root /srv/example.ltd/www; index index.php; access_log /srv/example.ltd/logs/nginx-main.log main; error_log /srv/example.ltd/logs/nginx-error.log warn; autoindex on; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { fastcgi_pass unix:/srv/example.ltd/tmp/example.ltd.sock; fastcgi_index index.php; fastcgi_param SCRIPT_NAME /www$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SERVER_NAME $host; fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name; include fastcgi_params; } } […]

chroot 64位 – > 32位='找不到命令'

很明显,32位不能chroot到64位,但我有信心,我已经成功chrooted从64位到32位使用Gentoo,但当我 [root@localhost ~]# mount /dev/vg_atom1/lv_root /mnt/lvm -o exec [root@localhost ~]# mount -t proc proc /mnt/lvm/proc [root@localhost ~]# mount –rbind /dev /mnt/lvm/dev [root@localhost ~]# mount –rbind /sys /mnt/lvm/sys [root@localhost ~]# chroot /mnt/lvm /bin/bash bash: uname: command not found [root@localhost /]# source /etc/profile 我明白了 bash: uname: command not found [root@localhost /]# cp -L /etc/resolv.conf /mnt/lvm/etc/ bash: cp: […]

创build一个Web用户

我在Arch Linux上运行Apache 2.4.8 ,但这并不重要。 我想创build一个致力于Webpipe理的用户。 我创build了一个用户,一个组,并将用户添加到组中。 我怎样才能添加visudo行,让他控制基于Web的服务? 我拥有正确设置的Web根的所有权,但是我需要组“ web ”以允许使用“ service.httpd ”,“ apachectl ”和其他Web程序。 我有: %web ALL=(ALL) /usr/bin/httpd

一个简单的,一步一步的方式设置“监狱”SFTP专用帐户

我觉得我已经通过互联网上的每一个SFTP / Chroot教程,并没有find我在找什么(或者,至less,他们没有产生正确的结果)。 这是我的细节: 我将通过脚本创build大量的个人用户帐户。 因此,任何需要我非常精细地手动编辑每个用户的文件的解决scheme都不是一件好事。 每个用户都会在/ var / www / html / USER文件夹中获得一个目录,其中USER是他们的用户名。 他们应该有对这个目录的全部写入权限,并且能够创build和编辑子目录,但是它们应该完全被locking在文件树中较高的任何目录之外(他们不应该能够列出,更不用说编辑,/ var / www / html /或/ var / www /或/ var /等) 而已。 看起来很简单吧? 然而,我所看到的大多数例子都是关于将所有的SFTP用户locking在一个单一的共享目录中,或者要求你将用户“监禁”到他们的/ home / USER目录(这对web服务不起作用)。 我不要那个。 我正在使用Ubuntu 16.04在新的AWS EC-2实例上执行此操作。 我试过的两种方法徒劳无功: 将用户的HOME设置为/ var / www / html / USER,Chroot将它们监控到HOME。 无论出于何种原因,这似乎并不奏效 – 这会导致SFTP拒绝连接。 为用户设置一个标准的HOME目录(例如使用adduser),创build用户的Web目录,Chroot将它们监控到Web目录。 尽pipe经历了几天的尝试,我还没有设法使这个工作–SFTP帐户仍然最终隧道到HOME目录,这往往意味着他们被拒绝Chroot监狱。 结果发生的是用户有太多的自由,或者完全被locking。 我从来没有设法进入一个情况,用户只能看到正确的目录,并能够编辑它。 我已经尝试了该目录下的每个chown设置(例如,user:user,user:sftp,root:root)和权限设置,似乎没有任何效果。 我错过了一些显而易见或深奥的东西。 […]

如何在nginx错误日志中隐藏部分path

有可能configurationnginx输出错误日志指定部分的文件path吗? 铁: 2017/09/16 19:59:28 [error] 10656#10656: *1702 open() "/home/user/www/favicon.ico" failed (2: No such file or directory), client: 256.256.256.256, server: example.com, request: "GET /favicon.ico HTTP/1.1", host: "example.com", referrer: "http://example.com/" 用户在“/ home / user /”上有chroot,所以这个用户的“favicon.ico”有这个path:“/www/favicon.ico”。 文件的真实path有点混乱。

运行BIND9在chroot中

我试图在Linux系统pipe理(Adelstein&Lubanovic)中讨论过,在一个Ubuntu机器上,在chroot监狱里运行bind9。 命令“sudo /etc/init.d/bind9 start”在syslog中生成错误: Jun 27 13:39:48 doli named[12418]: starting BIND 9.5.1-P2 -u bind -t /var/lib/named . . . Jun 27 13:39:48 doli named[12418]: loading configuration from '/etc/bind/named.conf' Jun 27 13:39:48 doli named[12418]: none:0: open: /etc/bind/named.conf: permission denied Jun 27 13:39:48 doli named[12418]: loading configuration: permission denied Jun 27 13:39:48 doli named[12418]: exiting (due to […]

是否可以在内核启动时将一个子目录作为根文件系统挂载?

我试图从我的主目录中的来源(如select创build一个专用的分区)安装一个Linux。 基本系统(glibc,kernel和init)安装在$ HOME / lfs / root下。 我使用安装在我的USB驱动器中的grub来启动这个系统,这里是grub.cfg中的相关部分(我必须将grub root更改为hd1,因为hd0是我的usb棒): menuentry“Custom linux HD”{set root ='(hd1,1)'linux / home / thiago / lfs / root / boot / bzImage root = / dev / sda1 / home / thiago / lfs / root ro} 似乎只有设备是“root =”的有效参数。 那有什么办法可以工作吗? 我不想惹我目前的分区。

vsftpd.conf中是否有等价的ToLower?

我正在使用虚拟用户运行一个vsFTP服务器。 我chroot每个用户到他们自己的个人子目录。 为了便于使用,我想让我的用户名不区分大小写,但是我遇到了一些麻烦,因为服务器总是使用他们input的确切的shell来parsing他们的chroot目录。 显然,这是行不通的,因为* NIX文件系统区分大小写。 有没有一种方法可以在vsftpd.conf(EG ToLower($ USER))中指定一个小写的值? 这样不pipe用户inputJSMITH还是jsmith,他们总是被chrooted到jsmith /?

挂载在chroot环境中的安全性影响

假设你有一个chroot环境,你需要一个资源 – 一个应用程序或一个库,它驻留在主机上(在chroot外部)。 哪些是安全的影响(如果有的话)执行mount –bind (从主机到chroot)在该资源上,而不是安装在chroot – 即通过apt-get install – ?