Reader small image

You're reading from  Mastering Bash

Product typeBook
Published inJun 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781784396879
Edition1st Edition
Languages
Right arrow
Author (1)
Giorgio Zarrelli
Giorgio Zarrelli
author image
Giorgio Zarrelli

Giorgio Zarrelli is a passionate GNU/Linux system administrator and Debian user, but has worked over the years with Windows, Mac, and OpenBSD, writing scripts, programming, installing and configuring services--whatever is required from an IT guy. He started tinkering seriously with servers back in his university days, when he took part in the Computational Philosophy Laboratory and was introduced to the Prolog language. As a young guy, he had fun being paid for playing games and write about them in video game magazines. Then he grew up and worked as an IT journalist and Nagios architect, and recently moved over to the threat intelligence field, where a lot of interesting stuff is happening nowadays. Over the years, he has worked for start-ups and well-established companies, among them In3 incubator and Onebip as a database and systems administrator, IBM as QRadar support, and Anomali as CSO, trying to find the best ways to help companies make the best out of IT. Giorgio has written several books in Italian on different topics related to IT, from Windows security to Linux system administration, covering MySQL DB administration and Bash scripting.
Read more about Giorgio Zarrelli

Right arrow

Restricted sftp sessions with OpenSSH

Using OpenSSH, everything can be easily done with five configuration lines and a few commands; let's see how. We are on the remote server.

First, let's open the OpenSSH file, which is usually found in /etc/ssh/sshd_config and add these few lines:

Match group sftp-only
ChrootDirectory /opt/jails/%u/exchange
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

We should already know what these directives are, but let's recall what we wrote in Chapter 12, Remote Connections over SSH, about remote connections over ssh:

  • Match: With this directive, we can use conditional statements so that if they are satisfied the following configuration lines, we will override the ones in the main configuration block. If a keyword/configuration block appears in more than one match clause, only the first instance is taken in to account...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Bash
Published in: Jun 2017Publisher: PacktISBN-13: 9781784396879

Author (1)

author image
Giorgio Zarrelli

Giorgio Zarrelli is a passionate GNU/Linux system administrator and Debian user, but has worked over the years with Windows, Mac, and OpenBSD, writing scripts, programming, installing and configuring services--whatever is required from an IT guy. He started tinkering seriously with servers back in his university days, when he took part in the Computational Philosophy Laboratory and was introduced to the Prolog language. As a young guy, he had fun being paid for playing games and write about them in video game magazines. Then he grew up and worked as an IT journalist and Nagios architect, and recently moved over to the threat intelligence field, where a lot of interesting stuff is happening nowadays. Over the years, he has worked for start-ups and well-established companies, among them In3 incubator and Onebip as a database and systems administrator, IBM as QRadar support, and Anomali as CSO, trying to find the best ways to help companies make the best out of IT. Giorgio has written several books in Italian on different topics related to IT, from Windows security to Linux system administration, covering MySQL DB administration and Bash scripting.
Read more about Giorgio Zarrelli