from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

87535

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->net-misc->openssh

Create a chrooted ssh user

This tutorial explains how to install and configure a chroot enviroment for an ssh user. This setup enables you to give out ssh accounts without having to fear that this user can see all files on the system.

Installing ssh

First you need to have a patched version of the sshd server. Luckily these patches can be enabled with the use flag "chroot" in the sshd use flags.
#echo "net-misc/openssh chroot" >> /etc/portage/package.use
#emerge openssh

creating the chroot enviroment

We will create our chroot enviroment in /home/chroot.
To make the chroot work, run the following commands to make the needed directories and devices for the chrooted user.
mkdir /home/chroot/
mkdir /home/chroot/home/
cd /home/chroot
mkdir etc
mkdir bin
mkdir lib
mkdir usr
mkdir usr/bin
mkdir dev
mknod dev/null c 1 3
mknod dev/zero c 1 5

Now we need to populate the directories with some binaries.
copy the following script into a file. If you need more apps, add them
to the APPS line.

APPS="/bin/bash /bin/ls /bin/mkdir /bin/mv /bin/pwd /bin/rm /usr/bin/id /usr/bin/ssh /bin/ping /usr/bin/dircolors"
for prog in $APPS; do
cp $prog ./$prog

# obtain a list of related libraries
ldd $prog > /dev/null
if [ "$?" = 0 ] ; then
LIBS=`ldd $prog | awk '{ print $3 }'`
for l in $LIBS; do
mkdir ./`dirname $l` > /dev/null 2>&1
cp $l ./$l
done
fi
done

After you have run the script, your chroot enviroment is almost done.
run

cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 ./lib/
echo '#!/bin/bash' > usr/bin/groups
echo "id -Gn" >> usr/bin/groups
touch etc/passwd
grep /etc/passwd -e "^root" > etc/passwd
to copy some libraries and user information into the chroot.
You should also copy the line of the group in which you will create new users from /etc/group to /home/chroot/etc/group. In this tutorial we will create users in the group users, so we do this:
grep /etc/group -e "^root" -e "^users" > etc/group

and restart SSH:
/etc/init.d/ssh restart

Creating chrooted users

ssh decides which user should be chrooted and which not by the "home directory" entry in the /etc/passwd.
Example for a non-chrooted user:
user_a:x:2002:100:User A:/home/user_a:/bin/bash
This user will be chrooted:
user_b:x:2003:100:User B:/home/chroot/./home/user_b:/bin/bash
Now lets add a testuser to the chrooted user list:
useradd -s /bin/bash -m -d /home/chroot/./home/testuser -c "testuser" -g users testuser

Then we give testuser a password:
passwd testuser

Finally, we have to copy the line for testuser in /etc/passwd to /home/chroot/etc/passwd:
grep /etc/passwd -e "^testuser" >> /home/chroot/etc/passwd


Now log in as testuser and see if everything worked.

Have fun
back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-08-09
lsp-ui - 8.0.1
Ebuild name:

app-emacs/lsp-ui-8.0.1

Description

UI modules for lsp-mode

Added to portage

2026-08-09

lsp-ui - 9.0.0
Ebuild name:

app-emacs/lsp-ui-9.0.0

Description

UI modules for lsp-mode

Added to portage

2026-08-09

lua-mode - 20210802
Ebuild name:

app-emacs/lua-mode-20210802

Description

An Emacs major mode for editing Lua scripts

Added to portage

2026-08-09

pdns - 5.0.7
Ebuild name:

net-dns/pdns-5.0.7

Description

The PowerDNS Daemon

Added to portage

2026-08-09

pdns - 5.1.4
Ebuild name:

net-dns/pdns-5.1.4

Description

The PowerDNS Daemon

Added to portage

2026-08-09

pdns-recursor - 5.3.10
Ebuild name:

net-dns/pdns-recursor-5.3.10

Description

The PowerDNS Recursor

Added to portage

2026-08-09

pdns-recursor - 5.4.5
Ebuild name:

net-dns/pdns-recursor-5.4.5

Description

The PowerDNS Recursor

Added to portage

2026-08-09

pkgcore - 0.12.38
Ebuild name:

sys-apps/pkgcore-0.12.38

Description

a framework for package management

Added to portage

2026-08-09

snakeoil - 0.11.4
Ebuild name:

dev-python/snakeoil-0.11.4

Description

misc common functionality and useful optimizations

Added to portage

2026-08-09

2026-08-08
Crypt-DSA-GMP - 0.20.0
Ebuild name:

dev-perl/Crypt-DSA-GMP-0.20.0

Description

DSA Signatures and Key Generation

Added to portage

2026-08-08

Crypt-OpenPGP - 1.210.0
Ebuild name:

dev-perl/Crypt-OpenPGP-1.210.0

Description

Pure-Perl OpenPGP-compatible PGP implementation

Added to portage

2026-08-08

JSON-WebToken - 0.100.0-r1
Ebuild name:

dev-perl/JSON-WebToken-0.100.0-r1

Description

JSON Web Token (JWT) implementation

Added to portage

2026-08-08

Math-Prime-Util-GMP - 0.530.0
Ebuild name:

dev-perl/Math-Prime-Util-GMP-0.530.0

Description

Utilities related to prime numbers and factoring, using GMP

Added to portage

2026-08-08

ast-serialize - 0.8.0
Ebuild name:

dev-python/ast-serialize-0.8.0

Description

Python bindings for mypy AST serialization

Added to portage

2026-08-08

astroid - 4.3.0
Ebuild name:

dev-python/astroid-4.3.0

Description

Abstract Syntax Tree for logilab packages

Added to portage

2026-08-08

binutils - 2.47
Ebuild name:

sys-devel/binutils-2.47

Description

Tools necessary to build programs

Added to portage

2026-08-08

binutils - 2.47.9999
Ebuild name:

sys-devel/binutils-2.47.9999

Description

Tools necessary to build programs

Added to portage

2026-08-08

binutils-hppa64 - 2.47
Ebuild name:

sys-devel/binutils-hppa64-2.47

Description

Tools necessary to build programs

Added to portage

2026-08-08

binutils-libs - 2.47
Ebuild name:

sys-libs/binutils-libs-2.47

Description

Core binutils libraries (libbfd, libopcodes, libiberty) for external pa

Added to portage

2026-08-08

bitarray - 3.10.1
Ebuild name:

dev-python/bitarray-3.10.1

Description

Efficient arrays of booleans -- C extension

Added to portage

2026-08-08

blessed - 1.48.0
Ebuild name:

dev-python/blessed-1.48.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-08-08

boto3 - 1.43.67
Ebuild name:

dev-python/boto3-1.43.67

Description

The AWS SDK for Python

Added to portage

2026-08-08

botocore - 1.43.67
Ebuild name:

dev-python/botocore-1.43.67

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-08

cachelib - 0.15.2
Ebuild name:

dev-python/cachelib-0.15.2

Description

Collection of cache libraries in the same API interface. Extracted from

Added to portage

2026-08-08

chrome-binary-plugins - 151.0.7922.108
Ebuild name:

www-plugins/chrome-binary-plugins-151.0.7922.108

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-08-08

chrome-binary-plugins - 152.0.7977.30_beta
Ebuild name:

www-plugins/chrome-binary-plugins-152.0.7977.30_beta

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-08-08

chrome-binary-plugins - 153.0.7993.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-153.0.7993.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-08-08

chromedriver-bin - 151.0.7922.108
Ebuild name:

www-apps/chromedriver-bin-151.0.7922.108

Description

WebDriver for Chrome

Added to portage

2026-08-08

chromium - 151.0.7922.108
Ebuild name:

www-client/chromium-151.0.7922.108

Description

Open-source version of Google Chrome web browser

Added to portage

2026-08-08

clion - 2026.1.4
Ebuild name:

dev-util/clion-2026.1.4

Description

A complete toolset for C and C++ development

Added to portage

2026-08-08

clion - 2026.2.0.1
Ebuild name:

dev-util/clion-2026.2.0.1

Description

A complete toolset for C and C++ development

Added to portage

2026-08-08

corsix-th - 0.70.0-r3
Ebuild name:

games-simulation/corsix-th-0.70.0-r3

Description

Open source clone of Theme Hospital

Added to portage

2026-08-08

dist-kernel - 6.1.182
Ebuild name:

virtual/dist-kernel-6.1.182

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-08

dist-kernel - 6.12.102
Ebuild name:

virtual/dist-kernel-6.12.102

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-08

dist-kernel - 6.6.150
Ebuild name:

virtual/dist-kernel-6.6.150

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-08

djangorestframework - 3.18.0
Ebuild name:

dev-python/djangorestframework-3.18.0

Description

Web APIs with django made easy

Added to portage

2026-08-08

dropbox - 264.4.3385
Ebuild name:

net-misc/dropbox-264.4.3385

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2026-08-08

element - 1.12.25
Ebuild name:

www-apps/element-1.12.25

Description

A glossy Matrix collaboration client for the web

Added to portage

2026-08-08

ffmpeg-chromium - 152
Ebuild name:

media-video/ffmpeg-chromium-152

Description

FFmpeg built specifically for codec support in Chromium-based brows

Added to portage

2026-08-08

gcc - 15.3.1_p20260807
Ebuild name:

sys-devel/gcc-15.3.1_p20260807

Description

The GNU Compiler Collection

Added to portage

2026-08-08

gentoo-kernel - 6.1.182
Ebuild name:

sys-kernel/gentoo-kernel-6.1.182

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel - 6.12.102
Ebuild name:

sys-kernel/gentoo-kernel-6.12.102

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel - 6.6.150
Ebuild name:

sys-kernel/gentoo-kernel-6.6.150

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel-bin - 6.1.182
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.182

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel-bin - 6.12.102
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.102

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel-bin - 6.6.150
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.150

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-08

gentoo-kernel-modprep - 6.1.182
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.1.182

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-08-08

gentoo-kernel-modprep - 6.12.102
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.102

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-08-08

gentoo-kernel-modprep - 6.6.150
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.6.150

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-08-08

ggml - 0.19.0
Ebuild name:

sci-ml/ggml-0.19.0

Description

Tensor library for machine learning

Added to portage

2026-08-08

goland - 2026.1.4
Ebuild name:

dev-util/goland-2026.1.4

Description

Golang IDE by JetBrains

Added to portage

2026-08-08

goland - 2026.2.0.1
Ebuild name:

dev-util/goland-2026.2.0.1

Description

Golang IDE by JetBrains

Added to portage

2026-08-08

google-chrome - 151.0.7922.108
Ebuild name:

www-client/google-chrome-151.0.7922.108

Description

The web browser from Google

Added to portage

2026-08-08

google-chrome-beta - 152.0.7977.30
Ebuild name:

www-client/google-chrome-beta-152.0.7977.30

Description

The web browser from Google

Added to portage

2026-08-08

google-chrome-unstable - 153.0.7993.0
Ebuild name:

www-client/google-chrome-unstable-153.0.7993.0

Description

The web browser from Google

Added to portage

2026-08-08

hiredis - 3.4.1
Ebuild name:

dev-python/hiredis-3.4.1

Description

Python extension that wraps hiredis

Added to portage

2026-08-08

jupyter-builder - 1.2.2
Ebuild name:

dev-python/jupyter-builder-1.2.2

Description

JupyterLab build tools

Added to portage

2026-08-08

librt - 0.15.0
Ebuild name:

dev-python/librt-0.15.0

Description

Mypyc runtime library

Added to portage

2026-08-08

mac - 13.22
Ebuild name:

media-sound/mac-13.22

Description

Monkey's Audio Codecs

Added to portage

2026-08-08

microsoft-edge - 151.0.4129.72
Ebuild name:

www-client/microsoft-edge-151.0.4129.72

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-beta - 151.0.4129.54
Ebuild name:

www-client/microsoft-edge-beta-151.0.4129.54

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-beta - 151.0.4129.59
Ebuild name:

www-client/microsoft-edge-beta-151.0.4129.59

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-beta - 152.0.4191.10
Ebuild name:

www-client/microsoft-edge-beta-152.0.4191.10

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-dev - 152.0.4181.1
Ebuild name:

www-client/microsoft-edge-dev-152.0.4181.1

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-dev - 152.0.4191.10
Ebuild name:

www-client/microsoft-edge-dev-152.0.4191.10

Description

The web browser from Microsoft

Added to portage

2026-08-08

microsoft-edge-dev - 152.0.4191.7
Ebuild name:

www-client/microsoft-edge-dev-152.0.4191.7

Description

The web browser from Microsoft

Added to portage

2026-08-08

mingw64-toolchain - 14.0.0_p1
Ebuild name:

dev-util/mingw64-toolchain-14.0.0_p1

Description

All-in-one mingw64 toolchain intended for building Wine withou

Added to portage

2026-08-08

nanobind - 2.14.0
Ebuild name:

dev-python/nanobind-2.14.0

Description

Tiny and efficient C++/Python bindings

Added to portage

2026-08-08

nextcloud - 32.0.13
Ebuild name:

www-apps/nextcloud-32.0.13

Description

Personal cloud that runs on your own server

Added to portage

2026-08-08

nextcloud - 33.0.7
Ebuild name:

www-apps/nextcloud-33.0.7

Description

Personal cloud that runs on your own server

Added to portage

2026-08-08

nextcloud - 34.0.2
Ebuild name:

www-apps/nextcloud-34.0.2

Description

Personal cloud that runs on your own server

Added to portage

2026-08-08

nghttp2 - 1.70.0
Ebuild name:

net-libs/nghttp2-1.70.0

Description

HTTP/2 C Library

Added to portage

2026-08-08

openhab-bin - 5.2.1
Ebuild name:

app-misc/openhab-bin-5.2.1

Description

An open-source automation software for your home

Added to portage

2026-08-08

opera - 134.0.5954.46
Ebuild name:

www-client/opera-134.0.5954.46

Description

A fast and secure web browser

Added to portage

2026-08-08

opera-developer - 136.0.5981.0
Ebuild name:

www-client/opera-developer-136.0.5981.0

Description

A fast and secure web browser

Added to portage

2026-08-08

oslo-config - 10.7.0
Ebuild name:

dev-python/oslo-config-10.7.0

Description

Oslo Configuration API

Added to portage

2026-08-08

pbs-installer - 2026.8.7
Ebuild name:

dev-python/pbs-installer-2026.8.7

Description

Installer for Python Build Standalone

Added to portage

2026-08-08

platformdirs - 4.11.1
Ebuild name:

dev-python/platformdirs-4.11.1

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-08-08

pycairo - 1.29.1
Ebuild name:

dev-python/pycairo-1.29.1

Description

Python bindings for the cairo library

Added to portage

2026-08-08

pycharm-professional - 2026.1.4
Ebuild name:

dev-util/pycharm-professional-2026.1.4

Description

Intelligent Python IDE with unique code assistance and analy

Added to portage

2026-08-08

pycharm-professional - 2026.2.0.1
Ebuild name:

dev-util/pycharm-professional-2026.2.0.1

Description

Intelligent Python IDE with unique code assistance and ana

Added to portage

2026-08-08

pydantic-settings - 2.15.0
Ebuild name:

dev-python/pydantic-settings-2.15.0

Description

Settings management using Pydantic

Added to portage

2026-08-08

qtile - 0.37.0
Ebuild name:

x11-wm/qtile-0.37.0

Description

A full-featured, hackable tiling window manager written in Python

Added to portage

2026-08-08

shtab - 1.10.0
Ebuild name:

dev-python/shtab-1.10.0

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-08-08

tesseract - 5.5.3
Ebuild name:

app-text/tesseract-5.5.3

Description

An OCR Engine, originally developed at HP, now open source

Added to portage

2026-08-08

tornado - 6.5.8
Ebuild name:

dev-python/tornado-6.5.8

Description

Python web framework and asynchronous networking library

Added to portage

2026-08-08

transformers - 5.14.1-r1
Ebuild name:

sci-ml/transformers-5.14.1-r1

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-08-08

transformers - 5.3.0-r1
Ebuild name:

sci-ml/transformers-5.3.0-r1

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-08-08

types-python-dateutil - 2.9.0.20260807
Ebuild name:

dev-python/types-python-dateutil-2.9.0.20260807

Description

Typing stubs for python-dateutil

Added to portage

2026-08-08

types-setuptools - 83.0.0.20260807
Ebuild name:

dev-python/types-setuptools-83.0.0.20260807

Description

Typing stubs for setuptools

Added to portage

2026-08-08

unreal - 227k_p14
Ebuild name:

games-fps/unreal-227k_p14

Description

Modern build of the original Unreal engine

Added to portage

2026-08-08

unreal-gold-data - 226b
Ebuild name:

games-fps/unreal-gold-data-226b

Description

Data files for Unreal and Return to Na Pali

Added to portage

2026-08-08

unreal-tournament - 469e-r1
Ebuild name:

games-fps/unreal-tournament-469e-r1

Description

Modern build of the Unreal Tournament (99) engine

Added to portage

2026-08-08

ut2004 - 3374_pre23-r1
Ebuild name:

games-fps/ut2004-3374_pre23-r1

Description

Modern build of the Unreal Tournament 2004 engine

Added to portage

2026-08-08

uv - 0.12.3
Ebuild name:

dev-python/uv-0.12.3

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-08-08

uv-build - 0.12.3
Ebuild name:

dev-python/uv-build-0.12.3

Description

PEP517 uv build backend

Added to portage

2026-08-08

vanilla-kernel - 6.1.182
Ebuild name:

sys-kernel/vanilla-kernel-6.1.182

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-08

vanilla-kernel - 6.12.102
Ebuild name:

sys-kernel/vanilla-kernel-6.12.102

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-08

vanilla-kernel - 6.6.150
Ebuild name:

sys-kernel/vanilla-kernel-6.6.150

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-08

vcs-versioning - 2.2.4
Ebuild name:

dev-python/vcs-versioning-2.2.4

Description

Core VCS versioning functionality from setuptools-scm

Added to portage

2026-08-08

virtualenv - 21.7.2
Ebuild name:

dev-python/virtualenv-21.7.2

Description

Virtual Python Environment builder

Added to portage

2026-08-08

vivaldi - 8.1.4087.61
Ebuild name:

www-client/vivaldi-8.1.4087.61

Description

A browser for our friends

Added to portage

2026-08-08

vivaldi-snapshot - 8.2.4116.3
Ebuild name:

www-client/vivaldi-snapshot-8.2.4116.3

Description

A browser for our friends

Added to portage

2026-08-08

vivaldi-snapshot - 8.2.4126.4
Ebuild name:

www-client/vivaldi-snapshot-8.2.4126.4

Description

A browser for our friends

Added to portage

2026-08-08

whenever - 0.10.5
Ebuild name:

dev-python/whenever-0.10.5

Description

Modern datetime library for Python

Added to portage

2026-08-08

zim - 0.77.2
Ebuild name:

x11-misc/zim-0.77.2

Description

A desktop wiki

Added to portage

2026-08-08

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 73.5 ms