Unix tools introduced. Today: Readonly SFTP

To create a user (sftp) with readonly  access via sftp to a single directory (/var/sftp_readonly), perform the following steps:

sudo su #become root

useradd sftp #create new user

passwd sftp #set a password

groupadd sftp_readonly #create a group

mkdir /var/sftp_readonly #create a directory

usermod -G sftp_readonly sftp # add user to group

chmod 755 /var/sftp_readonly/ #allow others to read

cp /etc/ssh/sshd_config ~/sshd_config.bck #backup your ssh config

editor  /etc/ssh/sshd_config # edit your ssh_config

Add the following lines to the bottom of /etc/ssh/sshd_config

Match Group sftp_readonly
  X11Forwarding no
  AllowTcpForwarding no
  ChrootDirectory /var/sftp_readonly/
  ForceCommand internal-sftp

Also make sure that the following line is present

Subsystem sftp internal-sftp

Reload your ssh service

sudo service ssh reload

 

 

“Raise the nose, HAL.” “I’m sorry, Dave, I can’t do that.”

This article looks like a must-read for software developers.

“The flight management computer is a computer. What that means is that it’s full not of aluminum bits, cables, fuel lines and all the other accoutrements of aviation. It’s full of lines of code. And that’s where things get dangerous.”

http://web.archive.org/web/20190328093447/https://drive.google.com/file/d/1249KS8xtIDKb5SxgpeFI6AD-PSC6nFA5/view

Also published here
https://spectrum.ieee.org/how-the-boeing-737-max-disaster-looks-to-a-software-developer

Urheberrecht dem Patentrecht angleichen

Dieser Kommentar auf Heise schlägt zur Umsetzung von Uploadfiltern folgendes vor:

  • Aufbau einer Datenbank mit allen urheberrechtlich geschützten Werken.
  • Eingang in die Datenbank per Antrag.
  • Teilweise Finanzierung der Antragsbearbeitung durch den Antragsteller.
  • Alles was nicht in der Datenbank ist, muss auch nicht vom Uploadfilter überprüft werden.

Unix tools introduced. Today: FHS

The Filesystem Hierarchy Standard (FHS) defines a standard layout to organize various kinds of application and OS related data in a predictable and common way [1].

A basic knowledge of the FHS will help you to find application or OS related data more easily. If you are a developer, it also provides a good orientation for organizing your own applications in a maintainable way, e.g. as ubuntu package.

/bin – essential user commands

/boot – OS boot loader

/dev – devices (everything is a file principle)

/etc – system configuration

/home – user data

/lib – essentail shared libraries

/media – mount point for removable media

/mnt – mount point for temporarily mounted filesystems

/opt – add-on applications

/root – home of root

/run – run time variable data

/sbin – system binaries

/srv – data for services provided by the system

/tmp – temporary data

/proc – is a virtual filesystem

/usr – secondary hierarchy

bin – Most user commands
lib – Libraries
local – Local hierarchy (empty after main installation)
sbin – Non-vital system binaries
share – Architecture-independent data

/var – variable data

cache  – Application cache data
lib  – Variable state information
local  – Variable data for /usr/local
lock –  Lock files
log – Log files and directories
opt – Variable data for /opt
run – Data relevant to running processes
spool – Application spool data
tmp  -Temporary files preserved between system reboots

Find more

What about – /init.d ?

What does the .d stand for in directory names?

FHS in Debian