Sponsored Content
Top Forums UNIX for Advanced & Expert Users Chroot jail environment puzzle Post 302470450 by jlliagre on Wednesday 10th of November 2010 07:48:08 AM
Old 11-10-2010
Quote:
Originally Posted by john.english
I don't see why it should do this, but... c'est la vie.
Because that would be an easy way for a casual user to compromise a system, i.e. execute malicious code as root.

---------- Post updated at 13:48 ---------- Previous update was at 13:36 ----------

Quote:
Originally Posted by john.english
The only way I know around this is to set LD_LIBRARY_PATH. Can anyone suggest a workaround?
Why do you need to set LD_LIBRARY_PATH for an internal library that should be found by default by the java run time ?
What says:
Code:
ldd /path-to/java

?
This User Gave Thanks to jlliagre For This Post:
 

9 More Discussions You Might Find Interesting

1. AIX

chroot environment

Hi!! I'm currently running AIX 4.3.3 and i'm trying to setup a chroot environment for the users who use SFTP, i spend a lot time SFTW but i can't make it work. I got openssh3.9p1 whit the chroot patch. Any help is greatly appreciated. (0 Replies)
Discussion started by: samurai79
0 Replies

2. Shell Programming and Scripting

Alias escape puzzle

Here is "escape puzzle" from real life task: Conditions: We need to create an alias which will Save current directory path Will ssh to particular server Then will cd to saved path (it's mounted via NFS) Then will find all files with name patter as "All*.bld" and run particular editor... (0 Replies)
Discussion started by: BaruchLi
0 Replies

3. Linux

It's a puzzle

Hi, Recently I installed Fedora 9 on the following hardware - Asus A8N-SLI Deluxe motherboard bios version 1805 - 2GB twinmos ram - AMD 4400 CPU - Tagan PSU 550 W - Asus EN6200LE video card - WD 74 GB Raptor - Areca ARC-1222 raid controller - 4x 1TB Seagate Baracudas - Symbios Logic... (6 Replies)
Discussion started by: jwoude
6 Replies

4. UNIX for Dummies Questions & Answers

How to start a chroot jail?

I was reading an article on how it is very important to setup a chroot jail to run bind. I can follow what the article says but one thing I am unclear about is now on system boot the BIND process in the chroot jail will start since it the owner will no longer be root but some other user. Can... (1 Reply)
Discussion started by: mojoman
1 Replies

5. IP Networking

Puzzle about sctp_bindx in UNP

It writes in Section 9.3 in Unix Network programming about SCTP: "The sctp_bindx call can be used on a bound or unbound socket." And then it writes: "The port number in all the socket address structures must be the same and must match any port number that is already bound; if it doesn't, then... (0 Replies)
Discussion started by: tomdean001
0 Replies

6. Debian

SSH chroot jail problems

Firstly Hi everyone :) I setup SFTP and SSH jail using this tutorial: http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny SFTP jail works however now when I try to SSH it accepts my password and then just goes to a blank screen. Type any command and the shell session is... (11 Replies)
Discussion started by: pokey144
11 Replies

7. Solaris

Swap puzzle

I'm getting confused by swap # swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 256,2 16 16777200 16777200 /dev/zvol/dsk/swappool/swap2 256,1 16 50331632 50331632 # swap -s total: 6710256k bytes allocated + 3402944k reserved = 10113200k used,... (6 Replies)
Discussion started by: redstone
6 Replies

8. UNIX for Dummies Questions & Answers

Creating chroot environment with an ISO file.

I decided to try creating a chroot environment with a BT5r2 iso file. I'm just wanting to run Backtrack from inside Debian without having to reboot into my other partition or use vmware. I found some documentation on how to do this with BT4 at this link: ... (0 Replies)
Discussion started by: Azrael
0 Replies

9. Red Hat

sftp jail chroot env setup

Hi I need a specific user to be able to sftp to a server and get files from a specific location. The location is not the users home dir, i don't want the user to be able to view anything else apart from the files in that area. e.g ftp file are is - /logging/phplogs e.g user home is... (1 Reply)
Discussion started by: duckeggs01
1 Replies
JAIL(2) 						      BSD System Calls Manual							   JAIL(2)

NAME
jail, jail_get, jail_set, jail_remove, jail_attach -- create and manage system jails LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/param.h> #include <sys/jail.h> int jail(struct jail *jail); int jail_attach(int jid); int jail_remove(int jid); #include <sys/uio.h> int jail_get(struct iovec *iov, u_int niov, int flags); int jail_set(struct iovec *iov, u_int niov, int flags); DESCRIPTION
The jail() system call sets up a jail and locks the current process in it. The argument is a pointer to a structure describing the prison: struct jail { uint32_t version; char *path; char *hostname; char *jailname; unsigned int ip4s; unsigned int ip6s; struct in_addr *ip4; struct in6_addr *ip6; }; ``version'' defines the version of the API in use. JAIL_API_VERSION is defined for the current version. The ``path'' pointer should be set to the directory which is to be the root of the prison. The ``hostname'' pointer can be set to the hostname of the prison. This can be changed from the inside of the prison. The ``jailname'' pointer is an optional name that can be assigned to the jail for example for management purposes. The ``ip4s'' and ``ip6s'' give the numbers of IPv4 and IPv6 addresses that will be passed via their respective pointers. The ``ip4'' and ``ip6'' pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to the prison, or NULL if none. IPv4 addresses must be in network byte order. This is equivalent to the jail_set() system call (see below), with the parameters path, host.hostname, name, ip4.addr, and ip6.addr, and with the JAIL_ATTACH flag. The jail_set() system call creates a new jail, or modifies an existing one, and optionally locks the current process in it. Jail parameters are passed as an array of name-value pairs in the array iov, containing niov elements. Parameter names are a null-terminated string, and values may be strings, integers, or other arbitrary data. Some parameters are boolean, and do not have a value (their length is zero) but are set by the name alone with or without a ``no'' prefix, e.g. persist or nopersist. Any parameters not set will be given default values, generally based on the current environment. Jails have a set of core parameters, and modules can add their own jail parameters. The current set of available parameters, and their for- mats, can be retrieved via the security.jail.param sysctl MIB entry. Notable parameters include those mentioned in the jail() description above, as well as jid and name, which identify the jail being created or modified. See jail(8) for more information on the core jail parame- ters. The flags arguments consists of one or more of the following flags: JAIL_CREATE Create a new jail. If a jid or name parameters exists, they must not refer to an existing jail. JAIL_UPDATE Modify an existing jail. One of the jid or name parameters must exist, and must refer to an existing jail. If both JAIL_CREATE and JAIL_UPDATE are set, a jail will be created if it does not yet exist, and modified if it does exist. JAIL_ATTACH In addition to creating or modifying the jail, attach the current process to it, as with the jail_attach() system call. JAIL_DYING Allow setting a jail that is in the process of being removed. The jail_get() system call retrieves jail parameters, using the same name-value list as jail_set() in the iov and niov arguments. The jail to read can be specified by either jid or name by including those parameters in the list. If they are included but are not intended to be the search key, they should be cleared (zero and the empty string respectively). The special parameter lastjid can be used to retrieve a list of all jails. It will fetch the jail with the jid above and closest to the passed value. The first jail (usually but not always jid 1) can be found by passing a lastjid of zero. The flags arguments consists of one or more following flags: JAIL_DYING Allow getting a jail that is in the process of being removed. The jail_attach() system call attaches the current process to an existing jail, identified by jid. The jail_remove() system call removes the jail identified by jid. It will kill all processes belonging to the jail, and remove any children of that jail. RETURN VALUES
If successful, jail(), jail_set(), and jail_get() return a non-negative integer, termed the jail identifier (JID). They return -1 on fail- ure, and set errno to indicate the error. The jail_attach() and jail_remove() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The jail() system call will fail if: [EPERM] This process is not allowed to create a jail, either because it is not the super-user, or because it would exceed the jail's children.max limit. [EFAULT] jail points to an address outside the allocated address space of the process. [EINVAL] The version number of the argument is not correct. [EAGAIN] No free JID could be found. The jail_set() system call will fail if: [EPERM] This process is not allowed to create a jail, either because it is not the super-user, or because it would exceed the jail's children.max limit. [EPERM] A jail parameter was set to a less restrictive value then the current environment. [EFAULT] Iov, or one of the addresses contained within it, points to an address outside the allocated address space of the process. [ENOENT] The jail referred to by a jid or name parameter does not exist, and the JAIL_CREATE flag is not set. [ENOENT] The jail referred to by a jid is not accessible by the process, because the process is in a different jail. [EEXIST] The jail referred to by a jid or name parameter exists, and the JAIL_UPDATE flag is not set. [EINVAL] A supplied parameter is the wrong size. [EINVAL] A supplied parameter is out of range. [EINVAL] A supplied string parameter is not null-terminated. [EINVAL] A supplied parameter name does not match any known parameters. [EINVAL] One of the JAIL_CREATE or JAIL_UPDATE flags is not set. [ENAMETOOLONG] A supplied string parameter is longer than allowed. [EAGAIN] There are no jail IDs left. The jail_get() system call will fail if: [EFAULT] Iov, or one of the addresses contained within it, points to an address outside the allocated address space of the process. [ENOENT] The jail referred to by a jid or name parameter does not exist. [ENOENT] The jail referred to by a jid is not accessible by the process, because the process is in a different jail. [ENOENT] The lastjid parameter is greater than the highest current jail ID. [EINVAL] A supplied parameter is the wrong size. [EINVAL] A supplied parameter name does not match any known parameters. The jail_attach() and jail_remove() system calls will fail if: [EPERM] A user other than the super-user attempted to attach to or remove a jail. [EINVAL] The jail specified by jid does not exist. Further jail(), jail_set(), and jail_attach() call chroot(2) internally, so they can fail for all the same reasons. Please consult the chroot(2) manual page for details. SEE ALSO
chdir(2), chroot(2), jail(8) HISTORY
The jail() system call appeared in FreeBSD 4.0. The jail_attach() system call appeared in FreeBSD 5.1. The jail_set(), jail_get(), and jail_remove() system calls appeared in FreeBSD 8.0. AUTHORS
The jail feature was written by Poul-Henning Kamp for R&D Associates ``http://www.rndassociates.com/'' who contributed it to FreeBSD. James Gritton added the extensible jail parameters and hierarchical jails. BSD
February 8, 2012 BSD
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy