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:

85257

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-05-21
asahi-sources - 7.0.9_p2
Ebuild name:

sys-kernel/asahi-sources-7.0.9_p2

Description

Asahi Linux kernel sources

Added to portage

2026-05-21

bind - 9.18.49
Ebuild name:

net-dns/bind-9.18.49

Description

Berkeley Internet Name Domain - Name Server

Added to portage

2026-05-21

bind - 9.20.23
Ebuild name:

net-dns/bind-9.20.23

Description

Berkeley Internet Name Domain - Name Server

Added to portage

2026-05-21

caffe2 - 2.12.0
Ebuild name:

sci-ml/caffe2-2.12.0

Description

A deep learning framework

Added to portage

2026-05-21

evince - 48.1-r1
Ebuild name:

app-text/evince-48.1-r1

Description

Simple document viewer for GNOME

Added to portage

2026-05-21

haruna - 1.7.1-r1
Ebuild name:

media-video/haruna-1.7.1-r1

Description

Video player built with Qt/QML and libmpv

Added to portage

2026-05-21

haruna - 1.8.1
Ebuild name:

media-video/haruna-1.8.1

Description

Video player built with Qt/QML and libmpv

Added to portage

2026-05-21

highs - 1.14.0-r2
Ebuild name:

sci-mathematics/highs-1.14.0-r2

Description

Modern solver for linear, quadratic, and mixed-integer programs

Added to portage

2026-05-21

kineto - 0.4.0_p20260410
Ebuild name:

sci-ml/kineto-0.4.0_p20260410

Description

part of the PyTorch Profiler

Added to portage

2026-05-21

mpvqt - 1.1.1-r3
Ebuild name:

media-libs/mpvqt-1.1.1-r3

Description

libmpv wrapper for QtQuick2 and QML

Added to portage

2026-05-21

mpvqt - 1.2.0
Ebuild name:

media-libs/mpvqt-1.2.0

Description

libmpv wrapper for QtQuick2 and QML

Added to portage

2026-05-21

multiple-cursors - 1.5.0
Ebuild name:

app-emacs/multiple-cursors-1.5.0

Description

Multiple cursors for Emacs

Added to portage

2026-05-21

muse - 3.20.2
Ebuild name:

app-emacs/muse-3.20.2

Description

An authoring and publishing environment for Emacs

Added to portage

2026-05-21

nagios-mode - 0.4
Ebuild name:

app-emacs/nagios-mode-0.4

Description

Major mode for editing Nagios configuration files

Added to portage

2026-05-21

navi2ch - 1.8.4-r2
Ebuild name:

app-emacs/navi2ch-1.8.4-r2

Description

A navigator for the Japanese textboard 2ch

Added to portage

2026-05-21

openvpn - 2.6.20
Ebuild name:

net-vpn/openvpn-2.6.20

Description

Robust and highly flexible tunneling application compatible with many OSes

Added to portage

2026-05-21

orderless - 1.7
Ebuild name:

app-emacs/orderless-1.7

Description

Completion style that matches multiple regexps in any order

Added to portage

2026-05-21

org-modern - 1.14
Ebuild name:

app-emacs/org-modern-1.14

Description

Modern style for your GNU Emacs Org buffers

Added to portage

2026-05-21

osm - 2.3
Ebuild name:

app-emacs/osm-2.3

Description

OpenStreetMap tile-based viewer for GNU Emacs

Added to portage

2026-05-21

paredit - 26-r2
Ebuild name:

app-emacs/paredit-26-r2

Description

Minor mode for performing structured editing of S-expressions

Added to portage

2026-05-21

pg_activity - 3.6.2
Ebuild name:

dev-db/pg_activity-3.6.2

Description

Realtime PostgreSQL database server monitoring tool

Added to portage

2026-05-21

pgbouncer - 1.25.2
Ebuild name:

dev-db/pgbouncer-1.25.2

Description

Lightweight connection pooler for PostgreSQL

Added to portage

2026-05-21

pipewire - 1.6.4-r1
Ebuild name:

media-video/pipewire-1.6.4-r1

Description

Multimedia processing graphs

Added to portage

2026-05-21

setuptools-gettext - 0.1.18
Ebuild name:

dev-python/setuptools-gettext-0.1.18

Description

Setuptools plugin for building mo files

Added to portage

2026-05-21

tempel - 1.13
Ebuild name:

app-emacs/tempel-1.13

Description

Templates with in-buffer field editing for GNU Emacs

Added to portage

2026-05-21

unbound - 1.25.1
Ebuild name:

net-dns/unbound-1.25.1

Description

A validating, recursive and caching DNS resolver

Added to portage

2026-05-21

util-linux - 2.41.4-r1
Ebuild name:

sys-apps/util-linux-2.41.4-r1

Description

Various useful Linux utilities

Added to portage

2026-05-21

valgrind - 3.27.1
Ebuild name:

dev-debug/valgrind-3.27.1

Description

An open-source memory debugger for GNU/Linux

Added to portage

2026-05-21

vaultwarden - 1.36.0
Ebuild name:

app-admin/vaultwarden-1.36.0

Description

Unofficial Bitwarden compatible password manager

Added to portage

2026-05-21

vaultwarden-web - 2026.4.1
Ebuild name:

www-apps/vaultwarden-web-2026.4.1

Description

Prebuilt web vault frontend for Vaultwarden

Added to portage

2026-05-21

vertico - 2.9
Ebuild name:

app-emacs/vertico-2.9

Description

Vertical interactive completion

Added to portage

2026-05-21

wireshark - 4.6.6
Ebuild name:

net-analyzer/wireshark-4.6.6

Description

Network protocol analyzer (sniffer)

Added to portage

2026-05-21

xfsprogs - 7.0.1
Ebuild name:

sys-fs/xfsprogs-7.0.1

Description

XFS filesystem utilities

Added to portage

2026-05-21

zen-sources - 7.0.9
Ebuild name:

sys-kernel/zen-sources-7.0.9

Description

The Zen Kernel Live Sources

Added to portage

2026-05-21

2026-05-20
aiodns - 4.0.4
Ebuild name:

dev-python/aiodns-4.0.4

Description

Simple DNS resolver for asyncio

Added to portage

2026-05-20

aws-sam-translator - 1.110.0
Ebuild name:

dev-python/aws-sam-translator-1.110.0

Description

A library that transform SAM templates into AWS CloudFormatio

Added to portage

2026-05-20

awscli - 1.45.11
Ebuild name:

app-admin/awscli-1.45.11

Description

Universal Command Line Environment for AWS

Added to portage

2026-05-20

badkeys - 0.0.18
Ebuild name:

app-crypt/badkeys-0.0.18

Description

Check cryptographic keys for known weaknesses

Added to portage

2026-05-20

boto3 - 1.43.11
Ebuild name:

dev-python/boto3-1.43.11

Description

The AWS SDK for Python

Added to portage

2026-05-20

botocore - 1.43.11
Ebuild name:

dev-python/botocore-1.43.11

Description

Low-level, data-driven core of boto 3

Added to portage

2026-05-20

claude-code - 2.1.144
Ebuild name:

dev-util/claude-code-2.1.144

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-05-20

dep-logic - 0.6.0
Ebuild name:

dev-python/dep-logic-0.6.0

Description

Python dependency specifications supporting logical operations

Added to portage

2026-05-20

dist-kernel - 5.10.256_p2
Ebuild name:

virtual/dist-kernel-5.10.256_p2

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 5.15.207_p2
Ebuild name:

virtual/dist-kernel-5.15.207_p2

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 6.1.173_p2
Ebuild name:

virtual/dist-kernel-6.1.173_p2

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 6.12.90_p1
Ebuild name:

virtual/dist-kernel-6.12.90_p1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 6.18.32_p1
Ebuild name:

virtual/dist-kernel-6.18.32_p1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 6.6.140_p1
Ebuild name:

virtual/dist-kernel-6.6.140_p1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

dist-kernel - 7.0.9_p1
Ebuild name:

virtual/dist-kernel-7.0.9_p1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-20

gentoo-kernel - 5.10.256_p2
Ebuild name:

sys-kernel/gentoo-kernel-5.10.256_p2

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 5.15.207_p2
Ebuild name:

sys-kernel/gentoo-kernel-5.15.207_p2

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 6.1.173_p2
Ebuild name:

sys-kernel/gentoo-kernel-6.1.173_p2

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 6.12.90_p1
Ebuild name:

sys-kernel/gentoo-kernel-6.12.90_p1

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 6.18.32_p1
Ebuild name:

sys-kernel/gentoo-kernel-6.18.32_p1

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 6.6.140_p1
Ebuild name:

sys-kernel/gentoo-kernel-6.6.140_p1

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel - 7.0.9_p1
Ebuild name:

sys-kernel/gentoo-kernel-7.0.9_p1

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 5.10.256_p2
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.256_p2

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 5.15.207_p2
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.207_p2

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 6.1.173_p2
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.173_p2

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 6.12.90_p1
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.90_p1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 6.18.32_p1
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.32_p1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 6.6.140_p1
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.140_p1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-kernel-bin - 7.0.9_p1
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.0.9_p1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-20

gentoo-sources - 5.10.256-r2
Ebuild name:

sys-kernel/gentoo-sources-5.10.256-r2

Description

Full sources including the Gentoo patchset for the . kernel t

Added to portage

2026-05-20

gentoo-sources - 5.15.207-r2
Ebuild name:

sys-kernel/gentoo-sources-5.15.207-r2

Description

Full sources including the Gentoo patchset for the . kernel t

Added to portage

2026-05-20

gentoo-sources - 6.1.173-r2
Ebuild name:

sys-kernel/gentoo-sources-6.1.173-r2

Description

Full sources including the Gentoo patchset for the . kernel tr

Added to portage

2026-05-20

gentoo-sources - 6.12.90-r2
Ebuild name:

sys-kernel/gentoo-sources-6.12.90-r2

Description

Full sources including the Gentoo patchset for the . kernel tr

Added to portage

2026-05-20

gentoo-sources - 6.18.32-r2
Ebuild name:

sys-kernel/gentoo-sources-6.18.32-r2

Description

Full sources including the Gentoo patchset for the . kernel tr

Added to portage

2026-05-20

gentoo-sources - 6.6.140-r2
Ebuild name:

sys-kernel/gentoo-sources-6.6.140-r2

Description

Full sources including the Gentoo patchset for the . kernel tr

Added to portage

2026-05-20

gentoo-sources - 7.0.9-r2
Ebuild name:

sys-kernel/gentoo-sources-7.0.9-r2

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-20

gentoo-sources - 7.0.9-r3
Ebuild name:

sys-kernel/gentoo-sources-7.0.9-r3

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-20

git-credential-manager - 2.8.0
Ebuild name:

dev-vcs/git-credential-manager-2.8.0

Description

Secure Git credential storage supporing GitHub, Azure Repos, a

Added to portage

2026-05-20

gr-osmosdr - 0.2.6-r2
Ebuild name:

net-wireless/gr-osmosdr-0.2.6-r2

Description

GNU Radio source block for OsmoSDR and rtlsdr and hackrf

Added to portage

2026-05-20

haveged - 1.9.21
Ebuild name:

sys-apps/haveged-1.9.21

Description

A simple entropy daemon using the HAVEGE algorithm

Added to portage

2026-05-20

hypothesis - 6.152.9
Ebuild name:

dev-python/hypothesis-6.152.9

Description

A library for property based testing

Added to portage

2026-05-20

ig - 0.52.0
Ebuild name:

app-admin/ig-0.52.0

Description

Tools and framework for data collection and system inspection using eBPF

Added to portage

2026-05-20

js8call - 3.0.1
Ebuild name:

media-radio/js8call-3.0.1

Description

Weak signal ham radio communication

Added to portage

2026-05-20

jsonschema-path - 0.5.0
Ebuild name:

dev-python/jsonschema-path-0.5.0

Description

JSONSchema Spec with object-oriented paths

Added to portage

2026-05-20

kitty - 0.47.0
Ebuild name:

x11-terms/kitty-0.47.0

Description

Fast, feature-rich, GPU-based terminal

Added to portage

2026-05-20

kitty-shell-integration - 0.47.0
Ebuild name:

x11-terms/kitty-shell-integration-0.47.0

Description

Shell integration scripts for kitty, a GPU-based terminal

Added to portage

2026-05-20

kitty-terminfo - 0.47.0
Ebuild name:

x11-terms/kitty-terminfo-0.47.0

Description

Terminfo for kitty, a GPU-based terminal emulator

Added to portage

2026-05-20

libbraiding - 1.3.2
Ebuild name:

sci-libs/libbraiding-1.3.2

Description

Expose the functionality of cbraid as a shared library

Added to portage

2026-05-20

libhomfly - 1.04
Ebuild name:

sci-libs/libhomfly-1.04

Description

Library to compute the homfly polynomial of a link

Added to portage

2026-05-20

linux-firmware - 20260519
Ebuild name:

sys-kernel/linux-firmware-20260519

Description

Linux firmware files

Added to portage

2026-05-20

mdbook - 0.5.3
Ebuild name:

app-text/mdbook-0.5.3

Description

Create a book from markdown files

Added to portage

2026-05-20

memcached - 1.6.42
Ebuild name:

net-misc/memcached-1.6.42

Description

High-performance, distributed memory object caching system

Added to portage

2026-05-20

nct6687d - 0_pre20260519
Ebuild name:

sys-power/nct6687d-0_pre20260519

Description

Kernel module for the Nuvoton NCT6687-R

Added to portage

2026-05-20

nuitka - 4.1.1
Ebuild name:

dev-python/nuitka-4.1.1

Description

Python to native compiler

Added to portage

2026-05-20

nvidia-drivers - 580.159.04
Ebuild name:

x11-drivers/nvidia-drivers-580.159.04

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-05-20

opentelemetry-api - 1.42.0
Ebuild name:

dev-python/opentelemetry-api-1.42.0

Description

OpenTelemetry Python API

Added to portage

2026-05-20

opentelemetry-sdk - 1.42.0
Ebuild name:

dev-python/opentelemetry-sdk-1.42.0

Description

OpenTelemetry Python SDK

Added to portage

2026-05-20

opentelemetry-semantic-conventions - 1.42.0
Ebuild name:

dev-python/opentelemetry-semantic-conventions-1.42.0

Description

OpenTelemetry Semantic Conventions

Added to portage

2026-05-20

parver - 1.0
Ebuild name:

dev-python/parver-1.0

Description

Parse and manipulate version numbers

Added to portage

2026-05-20

pathable - 0.6.0
Ebuild name:

dev-python/pathable-0.6.0

Description

Object-oriented paths

Added to portage

2026-05-20

procenv - 0.60-r1
Ebuild name:

sys-process/procenv-0.60-r1

Description

command-line utility to show process environment

Added to portage

2026-05-20

protobuf - 7.35.0
Ebuild name:

dev-python/protobuf-7.35.0

Description

Google's Protocol Buffers - Python bindings

Added to portage

2026-05-20

prusaslicer - 2.9.5
Ebuild name:

media-gfx/prusaslicer-2.9.5

Description

A mesh slicer to generate G-code for fused-filament-fabrication (3D pri

Added to portage

2026-05-20

pymysql - 1.2.0
Ebuild name:

dev-python/pymysql-1.2.0

Description

Pure-Python MySQL Driver

Added to portage

2026-05-20

python-glanceclient - 4.12.0
Ebuild name:

dev-python/python-glanceclient-4.12.0

Description

A client for the OpenStack Glance API

Added to portage

2026-05-20

railway - 2.10.1
Ebuild name:

gui-apps/railway-2.10.1

Description

Travel with all your train information in one place

Added to portage

2026-05-20

rq - 2.9.0
Ebuild name:

dev-python/rq-2.9.0

Description

Simple, lightweight library for creating and processing background jobs

Added to portage

2026-05-20

rsync - 3.4.3
Ebuild name:

net-misc/rsync-3.4.3

Description

File transfer program to keep remote files into sync

Added to portage

2026-05-20

tmuxp - 1.68.0
Ebuild name:

app-misc/tmuxp-1.68.0

Description

tmux session manager. built on libtmux

Added to portage

2026-05-20

wine-proton - 11.0.1_beta5
Ebuild name:

app-emulation/wine-proton-11.0.1_beta5

Description

Valve Software's fork of Wine

Added to portage

2026-05-20

yarl - 1.24.2
Ebuild name:

dev-python/yarl-1.24.2

Description

Yet another URL library

Added to portage

2026-05-20

zeroconf - 0.149.9
Ebuild name:

dev-python/zeroconf-0.149.9

Description

Pure Python Multicast DNS Service Discovery Library (Bonjour/Avahi comp

Added to portage

2026-05-20

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