A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children.

learn more… | top users | synonyms

17
votes
5answers
11k views

How can I chroot ssh connections?

I would like to setup a chroot jail for most (not all) users logging in though SSH. I've heard it's possible with the latest versions of openssh, but I've not been able to find out how to do it. The ...
9
votes
4answers
2k views

When is it appropriate / prudent to use chroot?

I hear about needing to chroot BIND all the time. Fair enough. But what about other programs? What are the "rules" (either personal or widely accepted/established) for deciding which programs ...
9
votes
3answers
526 views

RedHat: is it possible to install packages in a kind of mock environment to build RPMs

Is there a tool that allows to install the dependecies of an RPM .spec into an isolated environment? I won't install such dependencies globally on the system and I am not able to do so since I have ...
8
votes
3answers
6k views

Is there a windows equivalent to chroot?

On a *nix system I can use a chroot to isolate 2 processes from each other and from the rest of the system. Is there any similar security system under windows? Or is there any way to prevent 2 ...
7
votes
3answers
173 views

Why running named(bind) in chroot is so important for security? Or maybe it is not ?

I'm playing with bind and started wondering why this software is for example in CentOS running in chroot. Don't misunderstood me I know what bind is and what chroot (jail) is for. But my main wonder ...
7
votes
2answers
24k views

chroot fails - cannot run command `/bin/bash': No such file or directory

I'm a chroot novice trying to make a simple chroot jail but am banging my head against the same problem time and time again... Any help would be massively appreciated I've created a directory ...
6
votes
2answers
6k views

SFTP fatal bad ownership or modes for chroot directory ubuntu 12.04

I just set up my SFTP server and it works fine when I use it from my first user account. I wanted to add a user which we will call 'magnarp'. At first I did like this in sshd_config: Subsystem sftp ...
5
votes
2answers
481 views

Why chroot is considered insecure?

I've been playing around with CentOS box for couple of years now. So I'm pretty comfy with terminal. However, I read a lot of blog-post claiming that chroot is insecure and amount of those posts ...
5
votes
1answer
328 views

Why is chroot system call not available to non root user?

I was reading description about setuid on wikipedia http://en.wikipedia.org/wiki/Setuid I was unable to understand how chroot is related to setuid as mention in following paragraph from wikipedia ...
5
votes
4answers
674 views

Difference between chroot and jail

I read this tutorial - https://help.ubuntu.com/community/BasicChroot - and what I understood is that, chroot is the process of changing the / while the new restricted environment created is the ...
5
votes
5answers
4k views

Ubuntu - can non-root user run process in chroot jail?

Is it possible for a non-root user to run a chroot process on Ubuntu?
5
votes
4answers
2k views

OpenSSH anything like 'internal-sftp' but for SCP?

I'm running Debian stable and I'm looking to establish the following environment for users in my 'sftponly' group: jailed can transfer with SFTP can transfer with SCP cannot login interactively with ...
5
votes
4answers
362 views

Is there a chroot build script somewhere?

I am about to develop a little script to gather information for a chroot-jail. In my case this looks (at the first glance) pretty simple: The application has a clean rpm-install and did install ...
4
votes
7answers
1k views

Does using chroot for a publicly-exposed service provide any real security benefit?

I would like a definitive answer as to why this practice should be pursued with services that are exposed to potentially hostile network(s) (i.e. the Internet). As I understand it, there is a method ...
4
votes
3answers
4k views

Trying to setup chroot'd rsync

I'm trying to set up a backup server. I want to chroot each user (client) to its home directory, and only allow it to use sftp and rsync. I quickly discovered that I was not the only one trying to do ...
4
votes
1answer
3k views

PHP-FPM's chroot and chdir directory

I am setting up php-fpm with chrooting enabled. Now I see that there are two options, and I want to know what the exact difference is. The setup has: chroot = /var/www/domains/domain.tld/ ; Chdir to ...
4
votes
2answers
1k views

schroot fails to mount on entry

I'm trying to setup a chroot environment for myself, and it is failing. This has been reproduced on multiple versions (10.04 and 11.04) of Ubuntu. I set it up by doing: $ mkdir -p ...
4
votes
3answers
2k views

set up a chrooted SFTP login with OpenSSH

How might I create an SFTP login for an untrusted user in which he can only access the files in his own home directory and not run any commands? The online tutorial OpenSSH SFTP chroot() with ...
4
votes
2answers
1k views

What is the secure way to isolate ftp server users on unix?

I've read documentation for various ftp daemons and various long threads about the security implications of using a chroot environment for an ftp server when giving users write access. If you read the ...
3
votes
3answers
5k views

Why is “chroot” never used on Mac OS X?

I've been using Macs for 25 years, and "UNIX" since OS X 10.0.. but I've never really thought much about chroot, nor have I ever really needed or wanted to... It's a simple question, but... under ...
3
votes
2answers
104 views

How to create a link outside of the jail, but accessable within the jail?

I have created a chroot jail, but now I want to be able to create a link within the jail which links outside of the jail. Is this possible?
3
votes
1answer
2k views

SFTP: file symlinks in a jailed (chrooted) directory

I'm trying to set up sftp so that a few trusted people can access/edit/create some files. I have jailed a user into their home directory (/home/name) but have run into a problem. I want for them to ...
3
votes
1answer
6k views

VSFTPD - Change User Home Directory

I need to update a ftp user's home directory. Could I run the userdel command then re-add the user without losing the directory the user was attached to? Or is there another way to change the user's ...
3
votes
1answer
209 views

SFTP user can't edit or create files

Server: Ubuntu 12.04 LTS I am using openSSH and have created an SFTP user called bob who belongs to group sftponly. I have chrooted bob to his home directory which is /usr/share/nginx/www/bob/. bob ...
3
votes
1answer
819 views

Jail User to /var/www/username Directory via SSH

I have multiple folders in /var/www for different websites -- Apache uses name-based Virtual Hosts (Ubuntu Server). Suppose I want to allow someone to access their /var/www/user directory, but not cd ...
3
votes
3answers
1k views

Good resource for chrooting Apache2 on Debian

I need a better resource than this or this on how to secure Apache2 using chroot on a Debian system. It seems most articles deal with Apache1. I tried to follow them and adapt to Apache2, but it only ...
3
votes
1answer
179 views

Link all LXC node APT caches to the host machine's APT cache

I have a number of LXC containers (ubuntu template) which all have their own separate APT caches. /var/lib/lxc/*/rootfs/var/cache/apt/archives/ I would like to have these linked to the host ...
3
votes
1answer
180 views

Resource consumption of FreeBSD's jails

Just for curiosity. An example machine: an dedicated amd64 server with the last stable version of FreeBSD and UFS for the partitions. How much resources consume FreeBSD for each empty jail? I mean, I ...
3
votes
2answers
3k views

Proftpd: How to set default root to a users home directory without jailing the user?

I've installed proftpd on my debian box but I'm having having some trouble with the configuration. In my proftpd.conf I've added; DefaultRoot ~ !ftp_special This works fine in that all users except ...
3
votes
3answers
2k views

How to chroot Apache on CentOS?

I have been advised by a sysadmin, to run Apache in a chroot jail, in order to prevent that an attacker could take control of server. So my question is: What is the best method to chroot ...
3
votes
1answer
953 views

Increasing permissiveness/permissions for umask + openssh + chrooted SFTP server using internal-sftp

The suggestion found at these links works for me: How to setup ssh's umask for all type of connections http://ubuntuforums.org/showthread.php?t=1107974#5 Summary: Use PAM to inject the umask, ...
2
votes
3answers
594 views

Disable Linux Commands

I'm writing a simple program to back-up some files to a Linux box. The transaction will take place over SSH and each copy of the program will have its own account on the Linux box that it will ...
2
votes
4answers
2k views

Unmounting root filesystem without rebooting the server

I have a server that I can access through SSH. There is no KVM available and there's only one root partition for the whole server. I have deleted some files that I shouldn't have and want to recover ...
2
votes
2answers
2k views

Access files outside a chroot'ed environment?

I need to setup some users to access our server. I thought the most secure way to allow them access was to setup a chroot'ed jail for them to log into. But I need them to access a few select ...
2
votes
2answers
2k views

Virtualmin Chroot FTP Users

Can someone tell me how to chroot FTP users with Virtualmin, if it is possible.
2
votes
2answers
505 views

Defining hard links in puppet

Is there a way to define hardlinks inside puppet manifest? It seems file type can only define symbolic links, but I need it to be hard links in order to make some of my chrooted applications to work. ...
2
votes
1answer
881 views

Is it advisable to run Apache in a chroot jail?

I have been advised by a sysadmin guy I know, to run Apache in a chroot jail, for increased security. I have the following questions: Is this advisable (i.e. are there any 'gotcha's that I need to ...
2
votes
2answers
787 views

Is Chrooting apache/mysql/php a standard practice of securing web servers containing sensitive data?

Is Chrooting apache/mysql/php a standard practice of securing web servers containing sensitive data (is it necessary)?
2
votes
3answers
3k views

chrooting php-fpm with nginx

I'm setting up a new server with PHP 5.3.9 and nginx, so I compiled PHP with the php-fpm SAPI options. By itself it works great using the following server entry in nginx: server { listen 80; ...
2
votes
4answers
2k views

Prevent rssh users from leaving their jail directories

I'm attempting to use rssh to jail users strictly to their /home/user/public_html dirctories. I got it to work where an account can SFTP into the system successfully on a test server, but once I login ...
2
votes
2answers
1k views

Chroot for Mysql running on Ubuntu 10.10?

Prompted from a question about MySQL server security best practices, I've been running through this list (with a few minor alterations) to properly secure my server database server: ...
2
votes
2answers
306 views

Apache Error Log - “Web Path” instead of Filesystem Path

I'm running Apache on Linux and I'm using OpenSSH to provide SFTP access to some customers so they can upload their pages and also look at their respective site logs (access & error). I'm using ...
2
votes
2answers
1k views

What is the right way to chroot perl script?

I created /opt/chroot, create bin lib and other directories in it, copied libraries, bash and perl binaries in proper places. Also I placed my script into /opt/chroot/bin/. Now I can run the script ...
2
votes
1answer
324 views

Why use lxc instead of chroot?

One ubuntu server hosts 3 apps all on separate domains. Each app has its own developers. App developers belong to linux "sftp" group. chroot allows password sftp access for each app developer. ...
2
votes
1answer
841 views

Trying to set up SFTP only in a chroot jail for one user

Hopefully you guys can help and see if I've done something weird here, I'm trying to log in with a user I set up, FileZilla shows me: Command: open "///@///" Command: Pass: ******** Status: ...
2
votes
2answers
414 views

How to map authenticated Nginx users to their own directory?

I am writing a social networking site in C and serving it all up with Nginx. How can I make it so that authenticated users go to their own directory -ONLY- where a user-specific index.html resides. ...
2
votes
1answer
603 views

Debian: ip/network changes within chroot/jail

I've Debian Squeeze running and setup a chroot environment (/jail) with debootstrap. As seen in a tutorial, I mounted the following: proc on /jail/proc type proc (rw) devpts on /jail/dev/pts type ...
2
votes
2answers
1k views

Is MySecureShell a good way to manage SFTP user with chroot on a Centos Server?

I need to setup my Centos 5.4 server for SFTP with chrooted access only (or equivalent). The regular solution using RSSH find here : ...
2
votes
1answer
1k views

How to set chroot for SFTP under Ubuntu 8.04?

Ubuntu 8.04 LTS comes with OpenSSH 4.7, before the ChrootDirectory parameter was introduced. How can I upgrade OpenSSH to 4.9+? Alternatively, without upgrading OpenSSH, how can I set chroot?
2
votes
2answers
302 views

SFTP post upload hook

How would I run a script after a file has been successfully uploaded over (a chrooted) SFTP? I have this working on standard FTP connection using PureFTP ...