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:

77796

userrating:

average rating: 1.2 (8 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
rate this article:
current rating: average rating: 1.2 (48 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2025-07-01
bfs - 4.0.8
Ebuild name:

sys-apps/bfs-4.0.8

Description

Breadth-first version of the UNIX find command

Added to portage

2025-07-01

gtk-doc - 1.34.0-r2
Ebuild name:

dev-util/gtk-doc-1.34.0-r2

Description

GTK+ Documentation Generator

Added to portage

2025-07-01

kissfft - 131.1.0-r3
Ebuild name:

sci-libs/kissfft-131.1.0-r3

Description

A Fast Fourier Transform (FFT) library that tries to Keep it Simple, St

Added to portage

2025-07-01

mediawiki - 1.39.13
Ebuild name:

www-apps/mediawiki-1.39.13

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2025-07-01

mediawiki - 1.42.7
Ebuild name:

www-apps/mediawiki-1.42.7

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2025-07-01

mediawiki - 1.43.2
Ebuild name:

www-apps/mediawiki-1.43.2

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2025-07-01

powerline - 2.5_p20221110
Ebuild name:

app-emacs/powerline-2.5_p20221110

Description

GNU Emacs version of the Vim powerline

Added to portage

2025-07-01

sudo - 1.9.17_p1
Ebuild name:

app-admin/sudo-1.9.17_p1

Description

Allows users or groups to run commands as other users

Added to portage

2025-07-01

symengine - 0.14.0-r1
Ebuild name:

sci-libs/symengine-0.14.0-r1

Description

Fast symbolic manipulation library, written in C++

Added to portage

2025-07-01

2025-06-30
GSSAPI - 0.280.0-r3
Ebuild name:

dev-perl/GSSAPI-0.280.0-r3

Description

Perl extension providing access to the GSSAPIv2 library

Added to portage

2025-06-30

Graph-Easy - 0.760.0-r1
Ebuild name:

dev-perl/Graph-Easy-0.760.0-r1

Description

Convert or render graphs (as ASCII, HTML, SVG or via Graphviz)

Added to portage

2025-06-30

Graphics-ColorNames - 3.5.0-r2
Ebuild name:

dev-perl/Graphics-ColorNames-3.5.0-r2

Description

Defines RGB values for common color names

Added to portage

2025-06-30

Graphics-ColorNames-WWW - 1.140.0-r1
Ebuild name:

dev-perl/Graphics-ColorNames-WWW-1.140.0-r1

Description

WWW color names and equivalent RGB values

Added to portage

2025-06-30

Graphics-ColorObject - 0.5.0-r3
Ebuild name:

dev-perl/Graphics-ColorObject-0.5.0-r3

Description

Convert between color spaces

Added to portage

2025-06-30

Gtk3 - 0.38.0-r1
Ebuild name:

dev-perl/Gtk3-0.38.0-r1

Description

Perl interface to the 3.x series of the gtk+ toolkit

Added to portage

2025-06-30

Gtk3-SimpleList - 0.210.0-r1
Ebuild name:

dev-perl/Gtk3-SimpleList-0.210.0-r1

Description

Simple interface to GTK+ 3's complex MVC list widget

Added to portage

2025-06-30

Guard - 1.23.0-r2
Ebuild name:

dev-perl/Guard-1.23.0-r2

Description

Safe cleanup blocks

Added to portage

2025-06-30

HTML-Clean - 1.400.0-r1
Ebuild name:

dev-perl/HTML-Clean-1.400.0-r1

Description

Cleans up HTML code for web browsers, not humans

Added to portage

2025-06-30

HTML-Element-Extended - 1.180.0-r3
Ebuild name:

dev-perl/HTML-Element-Extended-1.180.0-r3

Description

Extension for manipulating a table composed of HTML style

Added to portage

2025-06-30

HTML-FormatText-WithLinks - 0.150.0-r3
Ebuild name:

dev-perl/HTML-FormatText-WithLinks-0.150.0-r3

Description

HTML to text conversion with links as footnotes

Added to portage

2025-06-30

HTML-HTMLDoc - 0.210.0-r1
Ebuild name:

dev-perl/HTML-HTMLDoc-0.210.0-r1

Description

Perl interface to the htmldoc program for producing PDF-Files from

Added to portage

2025-06-30

HTML-Highlight - 0.200.0-r2
Ebuild name:

dev-perl/HTML-Highlight-0.200.0-r2

Description

A module to highlight words or patterns in HTML documents

Added to portage

2025-06-30

HTML-Mason - 1.600.0-r1
Ebuild name:

dev-perl/HTML-Mason-1.600.0-r1

Description

A HTML development and delivery Perl Module

Added to portage

2025-06-30

HTML-Object - 2.30-r1
Ebuild name:

dev-perl/HTML-Object-2.30-r1

Description

A HTML development and delivery Perl Module

Added to portage

2025-06-30

Hash-Merge - 0.302.0-r1
Ebuild name:

dev-perl/Hash-Merge-0.302.0-r1

Description

Merges arbitrarily deep hashes into a single hash

Added to portage

2025-06-30

Hash-MoreUtils - 0.60.0-r1
Ebuild name:

dev-perl/Hash-MoreUtils-0.60.0-r1

Description

Provide the stuff missing in Hash

Added to portage

2025-06-30

Hash-MultiValue - 0.160.0-r2
Ebuild name:

dev-perl/Hash-MultiValue-0.160.0-r2

Description

Store multiple values per key

Added to portage

2025-06-30

android-studio - 2025.1.1.13
Ebuild name:

dev-util/android-studio-2025.1.1.13

Description

Android development environment based on IntelliJ IDEA

Added to portage

2025-06-30

anyascii - 0.3.3
Ebuild name:

dev-python/anyascii-0.3.3

Description

Unicode to ASCII transliteration

Added to portage

2025-06-30

colord - 1.4.8
Ebuild name:

x11-misc/colord-1.4.8

Description

System service to accurately color manage input and output devices

Added to portage

2025-06-30

cutecom - 0.60.0_rc1-r1
Ebuild name:

net-dialup/cutecom-0.60.0_rc1-r1

Description

Serial terminal, like minicom, written in Qt

Added to portage

2025-06-30

flux - 2.6.3
Ebuild name:

sys-cluster/flux-2.6.3

Description

Flux is a tool for keeping Kubernetes clusters in sync

Added to portage

2025-06-30

fontconfig - 2.17.0-r1
Ebuild name:

media-libs/fontconfig-2.17.0-r1

Description

A library for configuring and customizing font access

Added to portage

2025-06-30

gcc - 16.0.0_p20250629
Ebuild name:

sys-devel/gcc-16.0.0_p20250629

Description

The GNU Compiler Collection

Added to portage

2025-06-30

git-sources - 6.16_rc4
Ebuild name:

sys-kernel/git-sources-6.16_rc4

Description

The very latest -git version of the Linux kernel

Added to portage

2025-06-30

gnome-shell - 47.8
Ebuild name:

gnome-base/gnome-shell-47.8

Description

Provides core UI functions for the GNOME desktop

Added to portage

2025-06-30

go-perl - 0.150.0-r1
Ebuild name:

dev-perl/go-perl-0.150.0-r1

Description

GO parses all GO files formats and types

Added to portage

2025-06-30

gtk2-gladexml - 1.8.0-r1
Ebuild name:

dev-perl/gtk2-gladexml-1.8.0-r1

Description

Create user interfaces directly from Glade XML files

Added to portage

2025-06-30

incus - 6.14
Ebuild name:

app-containers/incus-6.14

Description

Modern, secure and powerful system container and virtual machine manager

Added to portage

2025-06-30

intel-compute-runtime - 25.22.33944.9
Ebuild name:

dev-libs/intel-compute-runtime-25.22.33944.9

Description

Intel Graphics Compute Runtime for oneAPI Level Zero a

Added to portage

2025-06-30

intel-graphics-compiler - 2.14.1
Ebuild name:

dev-util/intel-graphics-compiler-2.14.1

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel Gen

Added to portage

2025-06-30

intel-graphics-system-controller - 0.9.6
Ebuild name:

dev-util/intel-graphics-system-controller-0.9.6

Description

Intel graphics system controller firmware update li

Added to portage

2025-06-30

intel-metrics-discovery - 1.14.181
Ebuild name:

dev-libs/intel-metrics-discovery-1.14.181

Description

A user mode library that provides access to GPU performan

Added to portage

2025-06-30

intel-metrics-library - 1.0.198
Ebuild name:

dev-libs/intel-metrics-library-1.0.198

Description

User mode driver helper library that provides access to GPU

Added to portage

2025-06-30

intel-vc-intrinsics - 0.23.1
Ebuild name:

dev-libs/intel-vc-intrinsics-0.23.1

Description

A set of new intrinsics on top of core LLVM IR instructions

Added to portage

2025-06-30

kdegraphics-meta - 25.04.2-r1
Ebuild name:

kde-apps/kdegraphics-meta-25.04.2-r1

Description

kdegraphics - merge this to pull in all kdegraphics-derived pa

Added to portage

2025-06-30

kdegraphics-meta - 25.04.2-r2
Ebuild name:

kde-apps/kdegraphics-meta-25.04.2-r2

Description

kdegraphics - merge this to pull in all kdegraphics-derived pa

Added to portage

2025-06-30

kdepim-runtime - 25.04.2-r1
Ebuild name:

kde-apps/kdepim-runtime-25.04.2-r1

Description

Runtime plugin collection to extend the functionality of KDE PIM

Added to portage

2025-06-30

kdesdk-meta - 25.04.2-r1
Ebuild name:

kde-apps/kdesdk-meta-25.04.2-r1

Description

KDE SDK - merge this to pull in all kdesdk-derived packages

Added to portage

2025-06-30

kqtquickcharts - 25.07.70_pre20250625
Ebuild name:

kde-apps/kqtquickcharts-25.07.70_pre20250625

Description

Qt Quick plugin for beautiful and interactive charts

Added to portage

2025-06-30

ktouch - 25.07.70_pre20250628
Ebuild name:

kde-apps/ktouch-25.07.70_pre20250628

Description

Program that helps to learn and practice touch typing

Added to portage

2025-06-30

kube-apiserver - 1.31.10
Ebuild name:

sys-cluster/kube-apiserver-1.31.10

Description

Kubernetes API server

Added to portage

2025-06-30

kube-apiserver - 1.32.6
Ebuild name:

sys-cluster/kube-apiserver-1.32.6

Description

Kubernetes API server

Added to portage

2025-06-30

kube-apiserver - 1.33.2
Ebuild name:

sys-cluster/kube-apiserver-1.33.2

Description

Kubernetes API server

Added to portage

2025-06-30

kube-controller-manager - 1.31.10
Ebuild name:

sys-cluster/kube-controller-manager-1.31.10

Description

Kubernetes Controller Manager

Added to portage

2025-06-30

kube-controller-manager - 1.32.6
Ebuild name:

sys-cluster/kube-controller-manager-1.32.6

Description

Kubernetes Controller Manager

Added to portage

2025-06-30

kube-controller-manager - 1.33.2
Ebuild name:

sys-cluster/kube-controller-manager-1.33.2

Description

Kubernetes Controller Manager

Added to portage

2025-06-30

kube-proxy - 1.31.10
Ebuild name:

sys-cluster/kube-proxy-1.31.10

Description

Kubernetes Proxy service

Added to portage

2025-06-30

kube-proxy - 1.32.6
Ebuild name:

sys-cluster/kube-proxy-1.32.6

Description

Kubernetes Proxy service

Added to portage

2025-06-30

kube-proxy - 1.33.2
Ebuild name:

sys-cluster/kube-proxy-1.33.2

Description

Kubernetes Proxy service

Added to portage

2025-06-30

kube-scheduler - 1.31.10
Ebuild name:

sys-cluster/kube-scheduler-1.31.10

Description

Kubernetes Scheduler

Added to portage

2025-06-30

kube-scheduler - 1.32.6
Ebuild name:

sys-cluster/kube-scheduler-1.32.6

Description

Kubernetes Scheduler

Added to portage

2025-06-30

kube-scheduler - 1.33.2
Ebuild name:

sys-cluster/kube-scheduler-1.33.2

Description

Kubernetes Scheduler

Added to portage

2025-06-30

kubeadm - 1.31.10
Ebuild name:

sys-cluster/kubeadm-1.31.10

Description

CLI to Easily bootstrap a secure Kubernetes cluster

Added to portage

2025-06-30

kubeadm - 1.32.6
Ebuild name:

sys-cluster/kubeadm-1.32.6

Description

CLI to Easily bootstrap a secure Kubernetes cluster

Added to portage

2025-06-30

kubeadm - 1.33.2
Ebuild name:

sys-cluster/kubeadm-1.33.2

Description

CLI to Easily bootstrap a secure Kubernetes cluster

Added to portage

2025-06-30

kubectl - 1.31.10
Ebuild name:

sys-cluster/kubectl-1.31.10

Description

CLI to run commands against Kubernetes clusters

Added to portage

2025-06-30

kubectl - 1.32.6
Ebuild name:

sys-cluster/kubectl-1.32.6

Description

CLI to run commands against Kubernetes clusters

Added to portage

2025-06-30

kubectl - 1.33.2
Ebuild name:

sys-cluster/kubectl-1.33.2

Description

CLI to run commands against Kubernetes clusters

Added to portage

2025-06-30

kubelet - 1.31.10
Ebuild name:

sys-cluster/kubelet-1.31.10

Description

Kubernetes Node Agent

Added to portage

2025-06-30

kubelet - 1.32.6
Ebuild name:

sys-cluster/kubelet-1.32.6

Description

Kubernetes Node Agent

Added to portage

2025-06-30

kubelet - 1.33.2
Ebuild name:

sys-cluster/kubelet-1.33.2

Description

Kubernetes Node Agent

Added to portage

2025-06-30

kwallet - 6.13.0-r2
Ebuild name:

kde-frameworks/kwallet-6.13.0-r2

Description

Framework providing desktop-wide storage for passwords

Added to portage

2025-06-30

level-zero - 1.23.0
Ebuild name:

dev-libs/level-zero-1.23.0

Description

oneAPI Level Zero headers, loader and validation layer

Added to portage

2025-06-30

libapreq2 - 2.17-r2
Ebuild name:

www-apache/libapreq2-2.17-r2

Description

A library for manipulating client request data via the Apache API

Added to portage

2025-06-30

linux-firmware - 20250627
Ebuild name:

sys-kernel/linux-firmware-20250627

Description

Linux firmware files

Added to portage

2025-06-30

lxqt-powermanagement - 2.2.0-r1
Ebuild name:

lxqt-base/lxqt-powermanagement-2.2.0-r1

Description

LXQt daemon for power management and auto-suspend

Added to portage

2025-06-30

mariadb-connector-c - 3.4.5-r1
Ebuild name:

dev-db/mariadb-connector-c-3.4.5-r1

Description

C client library for MariaDB/MySQL

Added to portage

2025-06-30

metee - 6.0.0
Ebuild name:

dev-libs/metee-6.0.0

Description

Cross-platform access library for Intel CSME HECI interface

Added to portage

2025-06-30

mod_perl - 2.0.13-r2
Ebuild name:

www-apache/mod_perl-2.0.13-r2

Description

An embedded Perl interpreter for Apache2

Added to portage

2025-06-30

mutter - 47.9
Ebuild name:

x11-wm/mutter-47.9

Description

GNOME compositing window manager based on Clutter

Added to portage

2025-06-30

pcsx2 - 2.4.0
Ebuild name:

games-emulation/pcsx2-2.4.0

Description

PlayStation 2 emulator

Added to portage

2025-06-30

pdm - 2.25.4
Ebuild name:

dev-python/pdm-2.25.4

Description

Python package and dependency manager supporting the latest PEP standards

Added to portage

2025-06-30

selenium - 4.34.0
Ebuild name:

dev-python/selenium-4.34.0

Description

Python language binding for Selenium Remote Control

Added to portage

2025-06-30

selenium-manager - 4.34.0
Ebuild name:

dev-util/selenium-manager-4.34.0

Description

CLI tool that manages the browser/driver infrastructure required b

Added to portage

2025-06-30

squid - 6.14
Ebuild name:

net-proxy/squid-6.14

Description

Full-featured web proxy cache

Added to portage

2025-06-30

suite3270 - 4.4_p6
Ebuild name:

net-misc/suite3270-4.4_p6

Description

Complete 3270 (S390) access package

Added to portage

2025-06-30

texinfo - 7.2-r1
Ebuild name:

sys-apps/texinfo-7.2-r1

Description

The GNU info program and utilities

Added to portage

2025-06-30

ugrd - 2.0.1
Ebuild name:

sys-kernel/ugrd-2.0.1

Description

Python based POSIX initramfs generator with TOML definitions

Added to portage

2025-06-30

varnish - 7.7.1
Ebuild name:

www-servers/varnish-7.7.1

Description

Varnish is a state-of-the-art, high-performance HTTP accelerator

Added to portage

2025-06-30

yubikey-manager - 5.6.1-r2
Ebuild name:

app-crypt/yubikey-manager-5.6.1-r2

Description

Python library and command line tool for configuring a YubiKey

Added to portage

2025-06-30

yubikey-manager - 5.7.0-r2
Ebuild name:

app-crypt/yubikey-manager-5.7.0-r2

Description

Python library and command line tool for configuring a YubiKey

Added to portage

2025-06-30

yubikey-manager - 5.7.2
Ebuild name:

app-crypt/yubikey-manager-5.7.2

Description

Python library and command line tool for configuring a YubiKey

Added to portage

2025-06-30

yubikey-manager-qt - 1.2.5
Ebuild name:

app-crypt/yubikey-manager-qt-1.2.5

Description

Cross-platform application for configuring any YubiKey over all

Added to portage

2025-06-30

yubioath-flutter-bin - 6.1.0-r3
Ebuild name:

app-crypt/yubioath-flutter-bin-6.1.0-r3

Description

Yubico Authenticator for TOTP

Added to portage

2025-06-30

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 52.8 ms