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:

41697

userrating:

average rating: 1.5 (4 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



Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2018-07-17
adobe-flash - 30.0.0.134
Ebuild name:

www-plugins/adobe-flash-30.0.0.134

Description

Adobe Flash Player

Added to portage

2018-07-17

electrum - 3.2.2
Ebuild name:

net-misc/electrum-3.2.2

Description

User friendly Bitcoin client

Added to portage

2018-07-17

grpc - 1.13.1
Ebuild name:

net-libs/grpc-1.13.1

Description

Modern open source high performance RPC framework

Added to portage

2018-07-17

icu - 62.1
Ebuild name:

dev-libs/icu-62.1

Description

International Components for Unicode

Added to portage

2018-07-17

icu-layoutex - 62.1
Ebuild name:

dev-libs/icu-layoutex-62.1

Description

External layout part of International Components for Unicode

Added to portage

2018-07-17

mrtg - 2.17.7
Ebuild name:

net-analyzer/mrtg-2.17.7

Description

A tool to monitor the traffic load on network-links

Added to portage

2018-07-17

mutt - 1.10.1
Ebuild name:

mail-client/mutt-1.10.1

Description

A small but very powerful text-based mail client

Added to portage

2018-07-17

opera - 54.0.2952.54
Ebuild name:

www-client/opera-54.0.2952.54

Description

A fast and secure web browser

Added to portage

2018-07-17

opera-beta - 55.0.2994.14
Ebuild name:

www-client/opera-beta-55.0.2994.14

Description

A fast and secure web browser

Added to portage

2018-07-17

opera-developer - 56.0.3013.0
Ebuild name:

www-client/opera-developer-56.0.3013.0

Description

A fast and secure web browser

Added to portage

2018-07-17

pycurl - 7.43.0.2
Ebuild name:

dev-python/pycurl-7.43.0.2

Description

python binding for curl/libcurl

Added to portage

2018-07-17

sshguard - 2.2.0
Ebuild name:

app-admin/sshguard-2.2.0

Description

protects hosts from brute force attacks against ssh

Added to portage

2018-07-17

tor - 0.3.4.5_rc-r1
Ebuild name:

net-vpn/tor-0.3.4.5_rc-r1

Description

Anonymizing overlay network for TCP

Added to portage

2018-07-17

xfsprogs - 4.16.1-r1
Ebuild name:

sys-fs/xfsprogs-4.16.1-r1

Description

xfs filesystem utilities

Added to portage

2018-07-17

xfsprogs - 4.17.0-r1
Ebuild name:

sys-fs/xfsprogs-4.17.0-r1

Description

xfs filesystem utilities

Added to portage

2018-07-17

2018-07-16
apache - 2.4.34
Ebuild name:

www-servers/apache-2.4.34

Description

The Apache Web Server

Added to portage

2018-07-16

apache-tools - 2.4.34
Ebuild name:

app-admin/apache-tools-2.4.34

Description

Useful Apache tools - htdigest, htpasswd, ab, htdbm

Added to portage

2018-07-16

audio_capture - 0.3.3
Ebuild name:

dev-ros/audio_capture-0.3.3

Description

Transports audio from a source to a destination

Added to portage

2018-07-16

audio_common - 0.3.3
Ebuild name:

ros-meta/audio_common-0.3.3

Description

Common code for working with audio in ROS

Added to portage

2018-07-16

audio_common_msgs - 0.3.3
Ebuild name:

dev-ros/audio_common_msgs-0.3.3

Description

Messages for transmitting audio via ROS

Added to portage

2018-07-16

audio_play - 0.3.3
Ebuild name:

dev-ros/audio_play-0.3.3

Description

Outputs audio to a speaker from a source node

Added to portage

2018-07-16

bind - 9.12.2
Ebuild name:

net-dns/bind-9.12.2

Description

BIND - Berkeley Internet Name Domain - Name Server

Added to portage

2018-07-16

bind-tools - 9.12.2
Ebuild name:

net-dns/bind-tools-9.12.2

Description

bind tools dig, nslookup, host, nsupdate, dnssec-keygen

Added to portage

2018-07-16

bumblebee - 3.2.1_p20170130
Ebuild name:

x11-misc/bumblebee-3.2.1_p20170130

Description

Service providing elegant and stable means of managing Optimus g

Added to portage

2018-07-16

cura - 3.4.1
Ebuild name:

media-gfx/cura-3.4.1

Description

A 3D model slicing application for 3D printing

Added to portage

2018-07-16

curaengine - 3.4.1
Ebuild name:

media-gfx/curaengine-3.4.1

Description

A 3D model slicing engine for 3D printing

Added to portage

2018-07-16

datovka - 4.10.3
Ebuild name:

app-misc/datovka-4.10.3

Description

GUI to access the Czech eGov system of Datove schranky

Added to portage

2018-07-16

desktop - 1.4.1
Ebuild name:

ros-meta/desktop-1.4.1

Description

Metapackage for a basic ROS desktop install

Added to portage

2018-07-16

desktop_full - 1.4.1
Ebuild name:

ros-meta/desktop_full-1.4.1

Description

Metapackage for ROS complete desktop install

Added to portage

2018-07-16

dwz - 0.12
Ebuild name:

sys-devel/dwz-0.12

Description

DWARF optimization and duplicate removal tool

Added to portage

2018-07-16

elasticsearch - 6.3.1-r1
Ebuild name:

app-misc/elasticsearch-6.3.1-r1

Description

Open Source, Distributed, RESTful, Search Engine

Added to portage

2018-07-16

espresso++ - 2.0
Ebuild name:

sci-physics/espresso++-2.0

Description

A Modern Multiscale Simulation Package for Soft Matter Systems

Added to portage

2018-07-16

fdm-materials - 3.4.1
Ebuild name:

media-gfx/fdm-materials-3.4.1

Description

FDM materials for media-gfx/cura

Added to portage

2018-07-16

freeorion - 0.4.7.1-r4
Ebuild name:

games-strategy/freeorion-0.4.7.1-r4

Description

A free turn-based space empire and galactic conquest game

Added to portage

2018-07-16

gazebo - 9.2.0
Ebuild name:

sci-electronics/gazebo-9.2.0

Description

A 3D multiple robot simulator with dynamics

Added to portage

2018-07-16

gazebo_dev - 2.8.4
Ebuild name:

dev-ros/gazebo_dev-2.8.4

Description

Provides a cmake config for the default version of Gazebo for the ROS dist

Added to portage

2018-07-16

gazebo_msgs - 2.8.4
Ebuild name:

dev-ros/gazebo_msgs-2.8.4

Description

Message and service data structures for interacting with Gazebo from ROS

Added to portage

2018-07-16

gazebo_plugins - 2.8.4
Ebuild name:

dev-ros/gazebo_plugins-2.8.4

Description

Robot-independent Gazebo plugins for sensors, motors and dynamic recon

Added to portage

2018-07-16

gazebo_ros - 2.8.4
Ebuild name:

dev-ros/gazebo_ros-2.8.4

Description

ROS plugins that offer message and service publishers for interfacing with

Added to portage

2018-07-16

gazebo_ros_control - 2.8.4
Ebuild name:

dev-ros/gazebo_ros_control-2.8.4

Description

ROS control plugins for gazebo

Added to portage

2018-07-16

gazebo_ros_pkgs - 2.8.4
Ebuild name:

ros-meta/gazebo_ros_pkgs-2.8.4

Description

Interface for using ROS with the gazebo simulator

Added to portage

2018-07-16

gdal - 2.3.0-r1
Ebuild name:

sci-libs/gdal-2.3.0-r1

Description

Translator library for raster geospatial data formats (includes OGR support)

Added to portage

2018-07-16

geary - 0.12.3
Ebuild name:

mail-client/geary-0.12.3

Description

A lightweight, easy-to-use, feature-rich email client

Added to portage

2018-07-16

git-sources - 4.18_rc5
Ebuild name:

sys-kernel/git-sources-4.18_rc5

Description

The very latest -git version of the Linux kernel

Added to portage

2018-07-16

gntp - 1.0.3
Ebuild name:

dev-python/gntp-1.0.3

Description

Python library for working with the Growl Notification Transport Protocol

Added to portage

2018-07-16

grpc - 1.12.1-r1
Ebuild name:

net-libs/grpc-1.12.1-r1

Description

Modern open source high performance RPC framework

Added to portage

2018-07-16

grpc - 1.13.0-r1
Ebuild name:

net-libs/grpc-1.13.0-r1

Description

Modern open source high performance RPC framework

Added to portage

2018-07-16

haproxy - 1.8.12
Ebuild name:

net-proxy/haproxy-1.8.12

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2018-07-16

idn-ruby - 0.1.0
Ebuild name:

dev-ruby/idn-ruby-0.1.0

Description

LibIDN Ruby Bindings

Added to portage

2018-07-16

latte-dock - 0.8.0
Ebuild name:

kde-misc/latte-dock-0.8.0

Description

Elegant dock, based on KDE Frameworks

Added to portage

2018-07-16

libarcus - 3.4.1
Ebuild name:

dev-libs/libarcus-3.4.1

Description

This library facilitates communication between Cura and its backend

Added to portage

2018-07-16

libcharon - 3.4.1
Ebuild name:

dev-libs/libcharon-3.4.1

Description

This library facilitates communication between Cura and its backend

Added to portage

2018-07-16

libisds - 0.10.8
Ebuild name:

net-libs/libisds-0.10.8

Description

Client library for accessing ISDS Soap services

Added to portage

2018-07-16

libsavitar - 3.4.1
Ebuild name:

dev-libs/libsavitar-3.4.1

Description

C++ implementation of 3mf loading with SIP python bindings

Added to portage

2018-07-16

nm-applet - 1.8.14
Ebuild name:

gnome-extra/nm-applet-1.8.14

Description

GNOME applet for NetworkManager

Added to portage

2018-07-16

novnc - 1.0.0
Ebuild name:

www-apps/novnc-1.0.0

Description

noVNC is a VNC client implemented using HTML5 technologies

Added to portage

2018-07-16

openttd - 1.8.0
Ebuild name:

games-simulation/openttd-1.8.0

Description

OpenTTD is a clone of Transport Tycoon Deluxe

Added to portage

2018-07-16

openttd - 9999
Ebuild name:

games-simulation/openttd-9999

Description

OpenTTD is a clone of Transport Tycoon Deluxe

Added to portage

2018-07-16

pan - 0.145
Ebuild name:

net-nntp/pan-0.145

Description

A newsreader for GNOME

Added to portage

2018-07-16

pecl-gnupg - 1.4.0-r2
Ebuild name:

dev-php/pecl-gnupg-1.4.0-r2

Description

PHP wrapper around the gpgme library

Added to portage

2018-07-16

perception - 1.4.1
Ebuild name:

ros-meta/perception-1.4.1

Description

Metapackage for ROS perception stack

Added to portage

2018-07-16

piwigo - 2.9.4
Ebuild name:

www-apps/piwigo-2.9.4

Description

a photo gallery software for the web

Added to portage

2018-07-16

portage - 2.3.43
Ebuild name:

sys-apps/portage-2.3.43

Description

Portage is the package management and distribution system for Gentoo

Added to portage

2018-07-16

portage-mgorny - 2.3.43.2
Ebuild name:

sys-apps/portage-mgorny-2.3.43.2

Description

Fork of Portage focused on cleaning up and useful features

Added to portage

2018-07-16

portage-utils - 0.72
Ebuild name:

app-portage/portage-utils-0.72

Description

Small and fast Portage helper tools written in C

Added to portage

2018-07-16

postgresql - 11_beta2
Ebuild name:

dev-db/postgresql-11_beta2

Description

PostgreSQL RDBMS

Added to portage

2018-07-16

pyhamcrest - 1.9.0-r1
Ebuild name:

dev-python/pyhamcrest-1.9.0-r1

Description

Hamcrest framework for matcher objects

Added to portage

2018-07-16

pytest - 3.6.3
Ebuild name:

dev-python/pytest-3.6.3

Description

Simple powerful testing with Python

Added to portage

2018-07-16

rasdaemon - 0.6.1-r1
Ebuild name:

app-admin/rasdaemon-0.6.1-r1

Description

Reliability, Availability and Serviceability logging tool

Added to portage

2018-07-16

rcm - 1.3.3
Ebuild name:

app-admin/rcm-1.3.3

Description

rc file (dotfile) management

Added to portage

2018-07-16

repoman - 2.3.10
Ebuild name:

app-portage/repoman-2.3.10

Description

Repoman is a Quality Assurance tool for Gentoo ebuilds

Added to portage

2018-07-16

robot - 1.4.1
Ebuild name:

ros-meta/robot-1.4.1

Description

Metapackage which extends ros_base and includes ROS libaries for any robot har

Added to portage

2018-07-16

ros_base - 1.4.1
Ebuild name:

ros-meta/ros_base-1.4.1

Description

Metapackage which extends ros_core and includes other basic non-robot tools

Added to portage

2018-07-16

ros_core - 1.4.1
Ebuild name:

ros-meta/ros_core-1.4.1

Description

Metapackage to aggregate the packages required to use core ROS concepts

Added to portage

2018-07-16

rpm - 4.14.1-r1
Ebuild name:

app-arch/rpm-4.14.1-r1

Description

Red Hat Package Management Utils

Added to portage

2018-07-16

ruby - 2.4.4-r1
Ebuild name:

dev-lang/ruby-2.4.4-r1

Description

An object-oriented scripting language

Added to portage

2018-07-16

ruby - 2.5.1-r1
Ebuild name:

dev-lang/ruby-2.5.1-r1

Description

An object-oriented scripting language

Added to portage

2018-07-16

rubygems - 2.7.6-r1
Ebuild name:

dev-ruby/rubygems-2.7.6-r1

Description

Centralized Ruby extension management system

Added to portage

2018-07-16

rubygems - 2.7.7-r1
Ebuild name:

dev-ruby/rubygems-2.7.7-r1

Description

Centralized Ruby extension management system

Added to portage

2018-07-16

signal-desktop-bin - 1.14.1
Ebuild name:

net-im/signal-desktop-bin-1.14.1

Description

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

Added to portage

2018-07-16

simulators - 1.4.1
Ebuild name:

ros-meta/simulators-1.4.1

Description

Metapackage for ROS simulation packages

Added to portage

2018-07-16

sound_play - 0.3.3
Ebuild name:

dev-ros/sound_play-0.3.3

Description

ROS node that translates commands on a ROS topic (robotsound) into sounds

Added to portage

2018-07-16

telegram-desktop-bin - 1.3.10
Ebuild name:

net-im/telegram-desktop-bin-1.3.10

Description

Official desktop client for Telegram (binary package)

Added to portage

2018-07-16

twisted - 18.7.0
Ebuild name:

dev-python/twisted-18.7.0

Description

An asynchronous networking framework written in Python

Added to portage

2018-07-16

uglifier - 4.1.15
Ebuild name:

dev-ruby/uglifier-4.1.15

Description

Ruby wrapper for UglifyJS JavaScript compressor

Added to portage

2018-07-16

uqm - 0.7.0.1
Ebuild name:

games-strategy/uqm-0.7.0.1

Description

The Ur-Quan Masters Port of Star Control 2

Added to portage

2018-07-16

uranium - 3.4.1
Ebuild name:

dev-python/uranium-3.4.1

Description

A Python framework for building 3D printing related applications

Added to portage

2018-07-16

virtualbox - 5.2.14-r1
Ebuild name:

app-emulation/virtualbox-5.2.14-r1

Description

Family of powerful x86 virtualization products for enterprise an

Added to portage

2018-07-16

viz - 1.4.1
Ebuild name:

ros-meta/viz-1.4.1

Description

Metapackage for ROS visualization packages

Added to portage

2018-07-16

websocketpp - 0.8.1
Ebuild name:

dev-cpp/websocketpp-0.8.1

Description

C++/Boost Asio based websocket client/server library

Added to portage

2018-07-16

whois - 5.3.2
Ebuild name:

net-misc/whois-5.3.2

Description

improved Whois Client

Added to portage

2018-07-16

yabause - 0.9.15
Ebuild name:

games-emulation/yabause-0.9.15

Description

A Sega Saturn emulator

Added to portage

2018-07-16

znc - 1.7.1_rc1
Ebuild name:

net-irc/znc-1.7.1_rc1

Description

An advanced IRC Bouncer

Added to portage

2018-07-16

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
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: 59.8 ms