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:

85391

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-28
2026-05-27
algol68g - 3.12.2
Ebuild name:

dev-lang/algol68g-3.12.2

Description

Algol 68 Genie compiler-interpreter

Added to portage

2026-05-27

asio - 1.38.0
Ebuild name:

dev-cpp/asio-1.38.0

Description

Asynchronous Network Library

Added to portage

2026-05-27

awscli - 1.45.15
Ebuild name:

app-admin/awscli-1.45.15

Description

Universal Command Line Environment for AWS

Added to portage

2026-05-27

bino - 2.7
Ebuild name:

media-video/bino-2.7

Description

Stereoscopic and multi-display media player

Added to portage

2026-05-27

boto3 - 1.43.15
Ebuild name:

dev-python/boto3-1.43.15

Description

The AWS SDK for Python

Added to portage

2026-05-27

botocore - 1.43.15
Ebuild name:

dev-python/botocore-1.43.15

Description

Low-level, data-driven core of boto 3

Added to portage

2026-05-27

caffe2 - 2.12.0-r2
Ebuild name:

sci-ml/caffe2-2.12.0-r2

Description

A deep learning framework

Added to portage

2026-05-27

cargo-nextest - 0.9.135
Ebuild name:

dev-util/cargo-nextest-0.9.135

Description

Next-generation test runner for Rust

Added to portage

2026-05-27

charliecloud - 0.44
Ebuild name:

sys-cluster/charliecloud-0.44

Description

Lightweight user-defined software stacks for high-performance computi

Added to portage

2026-05-27

chrome-remote-desktop - 148.0.7778.58
Ebuild name:

net-misc/chrome-remote-desktop-148.0.7778.58

Description

access remote computers via Chrome

Added to portage

2026-05-27

coverage - 7.14.1
Ebuild name:

dev-python/coverage-7.14.1

Description

Code coverage measurement for Python

Added to portage

2026-05-27

cwm - 7.9
Ebuild name:

x11-wm/cwm-7.9

Description

OpenBSD fork of calmwm, a clean and lightweight window manager

Added to portage

2026-05-27

dbus-fast - 5.0.15
Ebuild name:

dev-python/dbus-fast-5.0.15

Description

A faster version of dbus-next

Added to portage

2026-05-27

django-prometheus - 2.5.0
Ebuild name:

dev-python/django-prometheus-2.5.0

Description

Library to export Django metrics for Prometheus

Added to portage

2026-05-27

djvu - 3.5.30
Ebuild name:

app-text/djvu-3.5.30

Description

DjVu viewers, encoders and utilities

Added to portage

2026-05-27

dnsdist - 2.0.6
Ebuild name:

net-dns/dnsdist-2.0.6

Description

A highly DNS-, DoS- and abuse-aware loadbalancer

Added to portage

2026-05-27

drkonqi - 6.6.5-r1
Ebuild name:

kde-plasma/drkonqi-6.6.5-r1

Description

Plasma crash handler, gives the user feedback if a program crashed

Added to portage

2026-05-27

eduvpn-client - 4.7.2
Ebuild name:

net-vpn/eduvpn-client-4.7.2

Description

Linux client and Python client API for eduVPN

Added to portage

2026-05-27

eduvpn-common - 5.0.2
Ebuild name:

net-vpn/eduvpn-common-5.0.2

Description

Linux client and Python client API for eduVPN

Added to portage

2026-05-27

elasticsearch - 9.4.1
Ebuild name:

dev-python/elasticsearch-9.4.1

Description

Official Elasticsearch client library for Python

Added to portage

2026-05-27

fheroes2 - 1.1.16
Ebuild name:

games-engines/fheroes2-1.1.16

Description

Recreation of HoMM2 game engine

Added to portage

2026-05-27

gap - 4.16.0_beta2
Ebuild name:

sci-mathematics/gap-4.16.0_beta2

Description

System for computational discrete algebra. Core functionality.

Added to portage

2026-05-27

girara - 2026.02.04
Ebuild name:

dev-libs/girara-2026.02.04

Description

UI library that focuses on simplicity and minimalism

Added to portage

2026-05-27

gkrellm - 2.5.1
Ebuild name:

app-admin/gkrellm-2.5.1

Description

Single process stack of various system monitors

Added to portage

2026-05-27

gnome-commander - 2.0.0
Ebuild name:

gnome-extra/gnome-commander-2.0.0

Description

A graphical, full featured, twin-panel file manager

Added to portage

2026-05-27

gpgme - 2.1.0
Ebuild name:

app-crypt/gpgme-2.1.0

Description

GnuPG Made Easy is a library for making GnuPG easier to use

Added to portage

2026-05-27

gpgmepp - 2.1.0
Ebuild name:

dev-cpp/gpgmepp-2.1.0

Description

GnuPG Made Easy is a library for making GnuPG easier to use (C++ bindings)

Added to portage

2026-05-27

grafana-bin - 12.4.3_p2
Ebuild name:

www-apps/grafana-bin-12.4.3_p2

Description

Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & O

Added to portage

2026-05-27

graphicsmagick - 1.3.47
Ebuild name:

media-gfx/graphicsmagick-1.3.47

Description

Collection of tools and libraries for many image formats

Added to portage

2026-05-27

hcloud - 1.65.0
Ebuild name:

app-admin/hcloud-1.65.0

Description

A command-line interface for Hetzner Cloud

Added to portage

2026-05-27

hxtools - 20251011-r1
Ebuild name:

dev-util/hxtools-20251011-r1

Description

Collection of tools and scripts

Added to portage

2026-05-27

hypothesis - 6.153.2
Ebuild name:

dev-python/hypothesis-6.153.2

Description

A library for property based testing

Added to portage

2026-05-27

icaclient - 26.01.0.150
Ebuild name:

net-misc/icaclient-26.01.0.150

Description

ICA Client for Citrix Presentation servers

Added to portage

2026-05-27

jack - 4.1_pre20260308
Ebuild name:

media-sound/jack-4.1_pre20260308

Description

A frontend for several cd-rippers and mp3 encoders

Added to portage

2026-05-27

just - 1.51.0
Ebuild name:

dev-build/just-1.51.0

Description

Just a command runner (with syntax inspired by 'make')

Added to portage

2026-05-27

kbd - 2.10.0
Ebuild name:

sys-apps/kbd-2.10.0

Description

Keyboard and console utilities

Added to portage

2026-05-27

kdstatemachineeditor - 2.3.1
Ebuild name:

dev-util/kdstatemachineeditor-2.3.1

Description

Framework for creating Qt State Machine metacode using graphica

Added to portage

2026-05-27

keepass - 2.61.1
Ebuild name:

app-admin/keepass-2.61.1

Description

A free, open source, light-weight and easy-to-use password manager

Added to portage

2026-05-27

kmscon - 10.0.0
Ebuild name:

sys-apps/kmscon-10.0.0

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-05-27

krita - 6.0.2
Ebuild name:

media-gfx/krita-6.0.2

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-05-27

lego - 5.1.0
Ebuild name:

app-crypt/lego-5.1.0

Description

Let's Encrypt/ACME client (like certbot or acme.sh) and library written in Go

Added to portage

2026-05-27

libresidfp - 1.0.2
Ebuild name:

media-libs/libresidfp-1.0.2

Description

Library to software emulation of the MOS 6581/8580 SID chip

Added to portage

2026-05-27

librsvg - 2.62.2
Ebuild name:

gnome-base/librsvg-2.62.2

Description

Scalable Vector Graphics (SVG) rendering library

Added to portage

2026-05-27

libsidplayfp - 3.0.0
Ebuild name:

media-libs/libsidplayfp-3.0.0

Description

Library for the sidplay2 fork with resid-fp

Added to portage

2026-05-27

libusb - 1.0.30
Ebuild name:

dev-libs/libusb-1.0.30

Description

Userspace access to USB devices

Added to portage

2026-05-27

libusb-compat - 0.1.9
Ebuild name:

dev-libs/libusb-compat-0.1.9

Description

Userspace access to USB devices (libusb-0.1 compat wrapper)

Added to portage

2026-05-27

lttng-modules - 2.14.5
Ebuild name:

dev-util/lttng-modules-2.14.5

Description

LTTng Kernel Tracer Modules

Added to portage

2026-05-27

lttng-ust - 2.14.2
Ebuild name:

dev-util/lttng-ust-2.14.2

Description

Linux Trace Toolkit - UST library

Added to portage

2026-05-27

minicoredumper - 2.0.8
Ebuild name:

sys-process/minicoredumper-2.0.8

Description

Core dump file processor

Added to portage

2026-05-27

mkvtoolnix - 99.0
Ebuild name:

media-video/mkvtoolnix-99.0

Description

Tools to create, alter, and inspect Matroska files

Added to portage

2026-05-27

modsecurity-crs - 4.26.0
Ebuild name:

www-apache/modsecurity-crs-4.26.0

Description

OWASP ModSecurity Core Rule Set

Added to portage

2026-05-27

mpd - 0.24.12
Ebuild name:

media-sound/mpd-0.24.12

Description

The Music Player Daemon (mpd)

Added to portage

2026-05-27

mujs - 1.3.9
Ebuild name:

dev-lang/mujs-1.3.9

Description

An embeddable JavaScript interpreter written in C

Added to portage

2026-05-27

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-27

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-27

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-27

nginx - 1.31.1
Ebuild name:

www-servers/nginx-1.31.1

Description

Added to portage

2026-05-27

nihtest - 1.11.1
Ebuild name:

dev-util/nihtest-1.11.1

Description

A testing tool for command line utilities

Added to portage

2026-05-27

njs - 0.9.9
Ebuild name:

www-nginx/njs-0.9.9

Description

A subset of JavaScript language to use in NGINX

Added to portage

2026-05-27

nushell - 0.113.0
Ebuild name:

app-shells/nushell-0.113.0

Description

A new type of shell, written in Rust

Added to portage

2026-05-27

nvidia-drivers - 610.43.02-r1
Ebuild name:

x11-drivers/nvidia-drivers-610.43.02-r1

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-05-27

openipmi - 2.0.36-r1
Ebuild name:

sys-libs/openipmi-2.0.36-r1

Description

Library interface to IPMI

Added to portage

2026-05-27

openipmi - 2.0.37-r1
Ebuild name:

sys-libs/openipmi-2.0.37-r1

Description

Library interface to IPMI

Added to portage

2026-05-27

openpgp-keys-johnogness - 20260524
Ebuild name:

sec-keys/openpgp-keys-johnogness-20260524

Description

OpenPGP keys used by John Ogness

Added to portage

2026-05-27

openpgp-keys-moritzbunkus - 20260524
Ebuild name:

sec-keys/openpgp-keys-moritzbunkus-20260524

Description

OpenPGP keys used by Moritz Bunkus

Added to portage

2026-05-27

opensc - 0.27.1
Ebuild name:

dev-libs/opensc-0.27.1

Description

Libraries and applications to access smartcards

Added to portage

2026-05-27

owntone - 29.2
Ebuild name:

media-sound/owntone-29.2

Description

DAAP (iTunes) and MPD media server

Added to portage

2026-05-27

pecl-amqp - 2.2.0
Ebuild name:

dev-php/pecl-amqp-2.2.0

Description

PHP Bindings for AMQP 0-9-1 compatible brokers

Added to portage

2026-05-27

peda - 1.2-r1
Ebuild name:

dev-debug/peda-1.2-r1

Description

Python Exploit Development Assistance for GDB

Added to portage

2026-05-27

petsc - 3.25.1
Ebuild name:

sci-mathematics/petsc-3.25.1

Description

Portable, Extensible Toolkit for Scientific Computation

Added to portage

2026-05-27

photoqt - 5.3
Ebuild name:

media-gfx/photoqt-5.3

Description

Simple but powerful Qt-based image viewer

Added to portage

2026-05-27

photoqt-extensions - 5.3
Ebuild name:

media-plugins/photoqt-extensions-5.3

Description

Official extensions for PhotoQt

Added to portage

2026-05-27

public-inbox - 2.1.0
Ebuild name:

net-mail/public-inbox-2.1.0

Description

An archives-first approach to mailing lists

Added to portage

2026-05-27

putty - 0.84
Ebuild name:

net-misc/putty-0.84

Description

A Free Telnet/SSH Client

Added to portage

2026-05-27

pypdf - 6.12.2
Ebuild name:

dev-python/pypdf-6.12.2

Description

Python library to work with PDF files

Added to portage

2026-05-27

pytest-asyncio - 1.4.0
Ebuild name:

dev-python/pytest-asyncio-1.4.0

Description

Library for testing asyncio code with pytest

Added to portage

2026-05-27

qgpgme - 2.1.0
Ebuild name:

dev-libs/qgpgme-2.1.0

Description

GnuPG Made Easy is a library for making GnuPG easier to use (Qt bindings)

Added to portage

2026-05-27

qtractor - 1.6.0
Ebuild name:

media-sound/qtractor-1.6.0

Description

Audio/MIDI multi-track sequencer written in C++ with the Qt framework

Added to portage

2026-05-27

qtspeech - 6.10.3-r1
Ebuild name:

dev-qt/qtspeech-6.10.3-r1

Description

Text-to-speech library for the Qt6 framework

Added to portage

2026-05-27

qtspeech - 6.11.1-r1
Ebuild name:

dev-qt/qtspeech-6.11.1-r1

Description

Text-to-speech library for the Qt6 framework

Added to portage

2026-05-27

radicale - 3.7.3
Ebuild name:

www-apps/radicale-3.7.3

Description

A simple CalDAV calendar server

Added to portage

2026-05-27

s3transfer - 0.17.1
Ebuild name:

dev-python/s3transfer-0.17.1

Description

An Amazon S3 Transfer Manager

Added to portage

2026-05-27

samba - 4.22.10
Ebuild name:

net-fs/samba-4.22.10

Description

Samba Suite Version 4

Added to portage

2026-05-27

samba - 4.23.8
Ebuild name:

net-fs/samba-4.23.8

Description

Samba Suite Version 4

Added to portage

2026-05-27

samba - 4.24.3
Ebuild name:

net-fs/samba-4.24.3

Description

Samba Suite Version 4

Added to portage

2026-05-27

sidplayfp - 3.0.0
Ebuild name:

media-sound/sidplayfp-3.0.0

Description

Sidplay2 fork with resid-fp

Added to portage

2026-05-27

signal-desktop-bin - 8.10.0
Ebuild name:

net-im/signal-desktop-bin-8.10.0

Description

Allows you to send and receive messages of Signal Messenger on you

Added to portage

2026-05-27

slepc - 3.25.1
Ebuild name:

sci-mathematics/slepc-3.25.1

Description

Scalable Library for Eigenvalue Problem Computations

Added to portage

2026-05-27

snowball-stemmer - 3.1.0
Ebuild name:

dev-libs/snowball-stemmer-3.1.0

Description

Snowball compiler and stemming algorithms

Added to portage

2026-05-27

sourcegit - 2026.11
Ebuild name:

dev-vcs/sourcegit-2026.11

Description

Open Source Git GUI client using .NET AvaloniaUI

Added to portage

2026-05-27

sssd - 2.13.0-r1
Ebuild name:

sys-auth/sssd-2.13.0-r1

Description

System Security Services Daemon provides access to identity and authenticat

Added to portage

2026-05-27

sssd - 2.9.9
Ebuild name:

sys-auth/sssd-2.9.9

Description

System Security Services Daemon provides access to identity and authentication

Added to portage

2026-05-27

stalonetray - 1.3.0-r1
Ebuild name:

x11-misc/stalonetray-1.3.0-r1

Description

System tray utility including support for KDE system tray icons

Added to portage

2026-05-27

stalwart-cli - 1.0.7
Ebuild name:

net-mail/stalwart-cli-1.0.7

Description

Stalwart Mail Server command line utility

Added to portage

2026-05-27

stalwart-mail - 0.16.6
Ebuild name:

net-mail/stalwart-mail-0.16.6

Description

Stalwart Mail Server

Added to portage

2026-05-27

stripe-mock - 0.200.0
Ebuild name:

dev-util/stripe-mock-0.200.0

Description

Mock HTTP server that responds like the real Stripe API

Added to portage

2026-05-27

strongswan - 6.0.6
Ebuild name:

net-vpn/strongswan-6.0.6

Description

IPsec-based VPN solution, supporting IKEv1/IKEv2 and MOBIKE

Added to portage

2026-05-27

sxcs - 1.2.1
Ebuild name:

x11-misc/sxcs-1.2.1

Description

Color picker and magnifier for X11

Added to portage

2026-05-27

system-monitoring-center - 3.4.1
Ebuild name:

sys-apps/system-monitoring-center-3.4.1

Description

Multi-featured system monitor GUI written in Python

Added to portage

2026-05-27

texstudio - 4.9.4
Ebuild name:

app-office/texstudio-4.9.4

Description

Free cross-platform LaTeX editor (fork from texmakerX)

Added to portage

2026-05-27

tortoisehg - 7.0.1-r1
Ebuild name:

dev-vcs/tortoisehg-7.0.1-r1

Description

Set of graphical tools for Mercurial

Added to portage

2026-05-27

urwid - 4.0.1
Ebuild name:

dev-python/urwid-4.0.1

Description

Curses-based user interface library for Python

Added to portage

2026-05-27

xen - 4.20.3
Ebuild name:

app-emulation/xen-4.20.3

Description

The Xen virtual machine monitor

Added to portage

2026-05-27

xen-tools - 4.20.3
Ebuild name:

app-emulation/xen-tools-4.20.3

Description

Xen tools including QEMU and xl

Added to portage

2026-05-27

zathura - 2026.02.22
Ebuild name:

app-text/zathura-2026.02.22

Description

Highly customizable & functional document viewer

Added to portage

2026-05-27

zathura-cb - 2026.02.03
Ebuild name:

app-text/zathura-cb-2026.02.03

Description

Comic book plug-in for zathura with 7zip, rar, tar and zip support

Added to portage

2026-05-27

zathura-djvu - 2026.02.03
Ebuild name:

app-text/zathura-djvu-2026.02.03

Description

DjVu plug-in for zathura

Added to portage

2026-05-27

zathura-pdf-mupdf - 2026.02.03
Ebuild name:

app-text/zathura-pdf-mupdf-2026.02.03

Description

PDF support for zathura using the mupdf PDF rendering library

Added to portage

2026-05-27

zathura-pdf-poppler - 2026.02.03
Ebuild name:

app-text/zathura-pdf-poppler-2026.02.03

Description

PDF plug-in for zathura

Added to portage

2026-05-27

zathura-ps - 2026.02.03
Ebuild name:

app-text/zathura-ps-2026.02.03

Description

PostScript plug-in for zathura

Added to portage

2026-05-27

zope-interface - 8.5
Ebuild name:

dev-python/zope-interface-8.5

Description

Interfaces for Python

Added to portage

2026-05-27

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