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:

85118

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-13
2026-05-12
backports-zstd - 1.5.0
Ebuild name:

dev-python/backports-zstd-1.5.0

Description

Backport of PEP-784 adding Zstandard to the standard library

Added to portage

2026-05-12

calligra - 26.04.1
Ebuild name:

app-office/calligra-26.04.1

Description

KDE Office Suite

Added to portage

2026-05-12

clang - 23.0.0_pre20260512
Ebuild name:

dev-python/clang-23.0.0_pre20260512

Description

Python bindings for llvm-core/clang

Added to portage

2026-05-12

clang - 23.0.0_pre20260512
Ebuild name:

llvm-core/clang-23.0.0_pre20260512

Description

C language family frontend for LLVM

Added to portage

2026-05-12

clang-common - 23.0.0_pre20260512
Ebuild name:

llvm-core/clang-common-23.0.0_pre20260512

Description

Common files shared between multiple slots of clang

Added to portage

2026-05-12

compiler-rt - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/compiler-rt-23.0.0_pre20260512

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-05-12

compiler-rt-sanitizers - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.0.0_pre20260512

Description

Compiler runtime libraries for clang (sanit

Added to portage

2026-05-12

cups - 2.4.19
Ebuild name:

net-print/cups-2.4.19

Description

The Common Unix Printing System

Added to portage

2026-05-12

cups-pdf - 3.0.3
Ebuild name:

net-print/cups-pdf-3.0.3

Description

Provides a virtual printer for CUPS to produce PDF files

Added to portage

2026-05-12

cvxopt - 1.3.3
Ebuild name:

dev-python/cvxopt-1.3.3

Description

Python package for convex optimization

Added to portage

2026-05-12

dtrace - 2.0.7
Ebuild name:

dev-debug/dtrace-2.0.7

Description

Dynamic BPF-based system-wide tracing tool

Added to portage

2026-05-12

dunshire - 0.1.3-r3
Ebuild name:

sci-mathematics/dunshire-0.1.3-r3

Description

Python library to solve linear games over symmetric cones

Added to portage

2026-05-12

elogind - 257.14
Ebuild name:

sys-auth/elogind-257.14

Description

The systemd project's logind, extracted to a standalone package

Added to portage

2026-05-12

flang - 23.0.0_pre20260512
Ebuild name:

llvm-core/flang-23.0.0_pre20260512

Description

LLVM's Fortran frontend

Added to portage

2026-05-12

flang-rt - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/flang-rt-23.0.0_pre20260512

Description

LLVM's Fortran runtime

Added to portage

2026-05-12

haproxy - 2.8.24
Ebuild name:

net-proxy/haproxy-2.8.24

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-12

haproxy - 3.0.23
Ebuild name:

net-proxy/haproxy-3.0.23

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-12

haproxy - 3.2.19
Ebuild name:

net-proxy/haproxy-3.2.19

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-12

haproxy - 3.3.10
Ebuild name:

net-proxy/haproxy-3.3.10

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-12

hypothesis - 6.152.6
Ebuild name:

dev-python/hypothesis-6.152.6

Description

A library for property based testing

Added to portage

2026-05-12

installer - 1.0.1
Ebuild name:

dev-python/installer-1.0.1

Description

A library for installing Python wheels

Added to portage

2026-05-12

jj - 0.41.0
Ebuild name:

dev-vcs/jj-0.41.0

Description

Jujutsu - an experimental version control system

Added to portage

2026-05-12

libclc - 23.0.0_pre20260512
Ebuild name:

llvm-core/libclc-23.0.0_pre20260512

Description

OpenCL C library

Added to portage

2026-05-12

libcxx - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/libcxx-23.0.0_pre20260512

Description

New implementation of the C++ standard library, targeting C

Added to portage

2026-05-12

libcxxabi - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/libcxxabi-23.0.0_pre20260512

Description

Low level support for a standard C++ library

Added to portage

2026-05-12

libgcc - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/libgcc-23.0.0_pre20260512

Description

Compiler runtime library for clang, compatible with libgcc_

Added to portage

2026-05-12

libunwind - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/libunwind-23.0.0_pre20260512

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-05-12

lit - 23.0.0_pre20260512
Ebuild name:

dev-python/lit-23.0.0_pre20260512

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-05-12

lld - 23.0.0_pre20260512
Ebuild name:

llvm-core/lld-23.0.0_pre20260512

Description

The LLVM linker (link editor)

Added to portage

2026-05-12

lldb - 23.0.0_pre20260512
Ebuild name:

llvm-core/lldb-23.0.0_pre20260512

Description

The LLVM debugger

Added to portage

2026-05-12

llvm - 23.0.0_pre20260512
Ebuild name:

dev-ml/llvm-23.0.0_pre20260512

Description

OCaml bindings for LLVM

Added to portage

2026-05-12

llvm - 23.0.0_pre20260512
Ebuild name:

llvm-core/llvm-23.0.0_pre20260512

Description

Low Level Virtual Machine

Added to portage

2026-05-12

llvm-common - 23.0.0_pre20260512
Ebuild name:

llvm-core/llvm-common-23.0.0_pre20260512

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-05-12

master-pdf-editor - 5.9.98
Ebuild name:

app-text/master-pdf-editor-5.9.98

Description

A complete solution for viewing and editing PDF files

Added to portage

2026-05-12

mlir - 23.0.0_pre20260512
Ebuild name:

llvm-core/mlir-23.0.0_pre20260512

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-05-12

mypy - 2.1.0
Ebuild name:

dev-python/mypy-2.1.0

Description

Optional static typing for Python

Added to portage

2026-05-12

nagios-icinga-openvpn - 0.0.1-r6
Ebuild name:

net-analyzer/nagios-icinga-openvpn-0.0.1-r6

Description

A Nagios plugin to check whether an OpenVPN server is a

Added to portage

2026-05-12

notmuch - 0.39-r1
Ebuild name:

net-mail/notmuch-0.39-r1

Description

Thread-based e-mail indexer, supporting quick search and tagging

Added to portage

2026-05-12

notmuch - 0.40-r2
Ebuild name:

net-mail/notmuch-0.40-r2

Description

Thread-based e-mail indexer, supporting quick search and tagging

Added to portage

2026-05-12

nuitka - 4.1
Ebuild name:

dev-python/nuitka-4.1

Description

Python to native compiler

Added to portage

2026-05-12

nvidia-vaapi-driver - 0.0.17
Ebuild name:

media-libs/nvidia-vaapi-driver-0.0.17

Description

A VA-API implemention using NVIDIA's NVDEC

Added to portage

2026-05-12

openmp - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/openmp-23.0.0_pre20260512

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-05-12

openmp-amdgcn-amd-amdhsa - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.0.0_pre20260512

Description

OpenMP target library for amdgcn devices

Added to portage

2026-05-12

openmp-nvptx64-nvidia-cuda - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.0.0_pre20260512

Description

OpenMP target library for nvptx64 devic

Added to portage

2026-05-12

openmp-spirv64-intel - 23.0.0_pre20260512
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.0.0_pre20260512

Description

OpenMP target library for spirv64 Intel devic

Added to portage

2026-05-12

pandas - 3.0.3
Ebuild name:

dev-python/pandas-3.0.3

Description

Powerful data structures for data analysis and statistics

Added to portage

2026-05-12

pbs-installer - 2026.5.10
Ebuild name:

dev-python/pbs-installer-2026.5.10

Description

Installer for Python Build Standalone

Added to portage

2026-05-12

php - 8.2.31
Ebuild name:

dev-lang/php-8.2.31

Description

The PHP language runtime engine

Added to portage

2026-05-12

php - 8.3.31
Ebuild name:

dev-lang/php-8.3.31

Description

The PHP language runtime engine

Added to portage

2026-05-12

php - 8.4.21
Ebuild name:

dev-lang/php-8.4.21

Description

The PHP language runtime engine

Added to portage

2026-05-12

php - 8.5.6
Ebuild name:

dev-lang/php-8.5.6

Description

The PHP language runtime engine

Added to portage

2026-05-12

polly - 23.0.0_pre20260512
Ebuild name:

llvm-core/polly-23.0.0_pre20260512

Description

Polyhedral optimizations for LLVM

Added to portage

2026-05-12

qt-docs - 6.11.1_p202605090529
Ebuild name:

dev-qt/qt-docs-6.11.1_p202605090529

Description

Qt6 documentation and examples for Qt Creator and other tools

Added to portage

2026-05-12

qt3d - 6.11.1
Ebuild name:

dev-qt/qt3d-6.11.1

Description

3D rendering module for the Qt6 framework

Added to portage

2026-05-12

qt5compat - 6.11.1
Ebuild name:

dev-qt/qt5compat-6.11.1

Description

Qt module containing the unsupported Qt 5 APIs

Added to portage

2026-05-12

qtbase - 6.11.1
Ebuild name:

dev-qt/qtbase-6.11.1

Description

Cross-platform application development framework

Added to portage

2026-05-12

qtcharts - 6.11.1
Ebuild name:

dev-qt/qtcharts-6.11.1

Description

Chart component library for the Qt6 framework

Added to portage

2026-05-12

qtconnectivity - 6.11.1
Ebuild name:

dev-qt/qtconnectivity-6.11.1

Description

Bluetooth and NFC support library for the Qt6 framework

Added to portage

2026-05-12

qtdeclarative - 6.11.1
Ebuild name:

dev-qt/qtdeclarative-6.11.1

Description

Qt Declarative (Quick 2)

Added to portage

2026-05-12

qtgraphs - 6.11.1
Ebuild name:

dev-qt/qtgraphs-6.11.1

Description

Graphs component library for the Qt6 framework

Added to portage

2026-05-12

qthttpserver - 6.11.1
Ebuild name:

dev-qt/qthttpserver-6.11.1

Description

HTTP server functionality for the Qt6 framework

Added to portage

2026-05-12

qtimageformats - 6.11.1
Ebuild name:

dev-qt/qtimageformats-6.11.1

Description

Additional format plugins for the Qt image I/O system

Added to portage

2026-05-12

qtlanguageserver - 6.11.1
Ebuild name:

dev-qt/qtlanguageserver-6.11.1

Description

Implementation of the Language Server Protocol for Qt

Added to portage

2026-05-12

qtlocation - 6.11.1
Ebuild name:

dev-qt/qtlocation-6.11.1

Description

Location (places, maps, navigation) library for the Qt6 framework

Added to portage

2026-05-12

qtmultimedia - 6.11.1
Ebuild name:

dev-qt/qtmultimedia-6.11.1

Description

Multimedia (audio, video, radio, camera) library for the Qt6 framework

Added to portage

2026-05-12

qtnetworkauth - 6.11.1
Ebuild name:

dev-qt/qtnetworkauth-6.11.1

Description

Network authorization library for the Qt6 framework

Added to portage

2026-05-12

qtpositioning - 6.11.1
Ebuild name:

dev-qt/qtpositioning-6.11.1

Description

Physical position determination library for the Qt6 framework

Added to portage

2026-05-12

qtquick3d - 6.11.1
Ebuild name:

dev-qt/qtquick3d-6.11.1

Description

Qt module and API for defining 3D content in Qt QuickTools

Added to portage

2026-05-12

qtquicktimeline - 6.11.1
Ebuild name:

dev-qt/qtquicktimeline-6.11.1

Description

Qt module for keyframe-based timeline construction

Added to portage

2026-05-12

qtremoteobjects - 6.11.1
Ebuild name:

dev-qt/qtremoteobjects-6.11.1

Description

Inter-Process Communication (IPC) library for the Qt6 framework

Added to portage

2026-05-12

qtscxml - 6.11.1
Ebuild name:

dev-qt/qtscxml-6.11.1

Description

State Chart XML (SCXML) support library for the Qt6 framework

Added to portage

2026-05-12

qtsensors - 6.11.1
Ebuild name:

dev-qt/qtsensors-6.11.1

Description

Hardware sensor access library for the Qt6 framework

Added to portage

2026-05-12

qtserialbus - 6.11.1
Ebuild name:

dev-qt/qtserialbus-6.11.1

Description

Qt module to access CAN, ModBus, and other industrial serial buses and pr

Added to portage

2026-05-12

qtserialport - 6.11.1
Ebuild name:

dev-qt/qtserialport-6.11.1

Description

Serial port abstraction library for the Qt6 framework

Added to portage

2026-05-12

qtshadertools - 6.11.1
Ebuild name:

dev-qt/qtshadertools-6.11.1

Description

Qt APIs and Tools for Graphics Pipelines

Added to portage

2026-05-12

qtspeech - 6.11.1
Ebuild name:

dev-qt/qtspeech-6.11.1

Description

Text-to-speech library for the Qt6 framework

Added to portage

2026-05-12

qtsvg - 6.11.1
Ebuild name:

dev-qt/qtsvg-6.11.1

Description

SVG rendering library for the Qt6 framework

Added to portage

2026-05-12

qttools - 6.11.1
Ebuild name:

dev-qt/qttools-6.11.1

Description

Qt Tools Collection

Added to portage

2026-05-12

qttranslations - 6.11.1
Ebuild name:

dev-qt/qttranslations-6.11.1

Description

Translation files for the Qt6 framework

Added to portage

2026-05-12

qtvirtualkeyboard - 6.11.1
Ebuild name:

dev-qt/qtvirtualkeyboard-6.11.1

Description

Customizable input framework and virtual keyboard for Qt

Added to portage

2026-05-12

qtwayland - 6.11.1
Ebuild name:

dev-qt/qtwayland-6.11.1

Description

Toolbox for making Qt based Wayland compositors

Added to portage

2026-05-12

qtwebchannel - 6.11.1
Ebuild name:

dev-qt/qtwebchannel-6.11.1

Description

Qt WebChannel

Added to portage

2026-05-12

qtwebengine - 6.11.1
Ebuild name:

dev-qt/qtwebengine-6.11.1

Description

Library for rendering dynamic web content in Qt6 C++ and QML applications

Added to portage

2026-05-12

qtwebsockets - 6.11.1
Ebuild name:

dev-qt/qtwebsockets-6.11.1

Description

Implementation of the WebSocket protocol for the Qt6 framework

Added to portage

2026-05-12

qtwebview - 6.11.1
Ebuild name:

dev-qt/qtwebview-6.11.1

Description

Module for displaying web content in a QML application using the Qt6 framew

Added to portage

2026-05-12

requests - 2.34.0
Ebuild name:

dev-python/requests-2.34.0

Description

HTTP library for human beings

Added to portage

2026-05-12

requests-cache - 1.3.2
Ebuild name:

dev-python/requests-cache-1.3.2

Description

Persistent cache for requests library

Added to portage

2026-05-12

rssguard - 5.1.2
Ebuild name:

net-news/rssguard-5.1.2

Description

Simple (yet powerful) news feed reader

Added to portage

2026-05-12

scala-cli-bin - 1.13.0
Ebuild name:

dev-java/scala-cli-bin-1.13.0

Description

CLI to interact with Scala and Java

Added to portage

2026-05-12

signal-desktop-bin - 8.9.1
Ebuild name:

net-im/signal-desktop-bin-8.9.1

Description

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

Added to portage

2026-05-12

syncthing - 2.1.0
Ebuild name:

net-p2p/syncthing-2.1.0

Description

Open Source Continuous File Synchronization

Added to portage

2026-05-12

translate-toolkit - 3.19.9
Ebuild name:

dev-python/translate-toolkit-3.19.9

Description

Toolkit to convert between many translation formats

Added to portage

2026-05-12

twisted - 26.4.0
Ebuild name:

dev-python/twisted-26.4.0

Description

An asynchronous networking framework written in Python

Added to portage

2026-05-12

untangle-https-backup - 0.1.0-r4
Ebuild name:

app-backup/untangle-https-backup-0.1.0-r4

Description

Back up Untangle configurations via the web admin UI

Added to portage

2026-05-12

zen-sources - 7.0.6
Ebuild name:

sys-kernel/zen-sources-7.0.6

Description

The Zen Kernel Live Sources

Added to portage

2026-05-12

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