GICT knowledge base
Install and setup rssh and scponly
Published
How to install and setup rssh and scponly?
With use of OpenSSH, rssh is a restricted shell, scp and sftp are only allow. It also includes rdist, rsync and cvs support. Rssh is also known to work for a list of platform. Scponly is an alternative shell. The system administrators provide access with read and write local files without providing remote execution privilege to the remote user. A common usage of scponly is creating semi-public account. It is best described as a wrapper to the tried and true ssh suite of applications.
Installation
We can use yum or apt-get to install rssh and scponly in servers.
# apt-get install rssh
# apt-get install scponly
# yum install rssh
# yum install scponly
If there are any problems occurs to install rssh, then you should download sources and do the following steps.
./configure,
make
make install
Here are the links:
latest rssh .tar.gz
latest scponly .tgz.
Configuration
scponly does not need any configuration and works out of the box so you just should set it as a shell for user account.
Create new user account with scponly.
# useradd -s /usr/sbin/scponly user
To modify user account to set rssh as a shell
# usermod -s /usr/sbin/rssh user2
Restrict all users to scp and rsync only then you should uncomment lines in rssh.conf.
allowscp
#allowsftp
#allowcvs
#allowrdist
allowrsync
Testing
The user1 is enabled only scp and rsync using rssh. To access the server via SSH under user1 account will end with the following output.
ssh user1@IP
user1@IP’s password:
This account is restricted by rssh.
Allowed commands: scp rsync
If you believe this is in error, please contact your system administrator.
Connection to IP closed.
But in the same time scp transfers will work without any problem
scp -P 23451 /etc/test.file user1@IP:/tmp
user1@IP’s password:
test.file 100% 983 1.0KB/s 00:00
If you need any further assistance please reach our support department.
Related guides
How to Restrict an SSH Key to One Command
Restrict an SSH key to one command with authorized_keys options. Protect the command and check that unwanted shell and forwarding access are denied.
Linux and CommandsSelf-Hosted Video Processing With FFmpeg: A Practical Guide
Learn how to self-host video processing on a VPS using FFmpeg, with practical commands for conversion, compression, thumbnails, and automated workflows.
Linux and CommandsHow to use nohup: Commands in Linux That Survive Terminal Closes
Keep commands running after you close the terminal. nohup examples with wget, Python, rsync, and Docker on any VPS.
Linux and CommandsHow to Fix “Too Many Open Files” Error on Linux Servers
Learn how to fix the "Too Many Open Files" error on Linux servers by understanding file descriptors, adjusting limits, and diagnosing leaks effectively.
