A lot of IP cams have some "brains on board" and can at least do motion detection, then sent a frame or even a video to an FTP server or NAS. E.g. the Amcrest IPC-XD824-N which are available for very little online.
vsftpd takes up very little space or compute. Install is easy with sudo apt install vsftpd
For a little security, we can make a user that has no rights other than to send images via FTP.
# Create the shared 'camera' user
sudo useradd -m camera -d /mnt/ssd_data/camera -s /usr/sbin/nologin
sudo passwd camera
# Set up the directory structure on the SSD (use the SD card if you live dangerously)
sudo mkdir -p /mnt/ssd_data/camera/doorbell
sudo mkdir -p /mnt/ssd_data/camera/chickens
sudo mkdir -p /mnt/ssd_data/camera/porch
# Permissions: Root owns the 'jail' base, 'camera' owns the subfolders
sudo chown root:root /mnt/ssd_data/camera
sudo chmod 755 /mnt/ssd_data/camera
sudo chown -R camera:camera /mnt/ssd_data/camera/*
# Let PAM know that a nologin user is ok
echo "/usr/sbin/nologin" | sudo tee -a /etc/shells
# Open the config file:
sudo nano /etc/vsftpd.conf
Delete everything inside (or comment it out) and paste this lean, functional configuration. This is optimized for a local network camera:
# Basic Settings
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
# Security & Jailing
chroot_local_user=YES
allow_writeable_chroot=YES
force_dot_files=YES
pam_service_name=vsftpd
check_shell=NO
# Landing Zone
local_root=/mnt/ssd_data/camera
# Passive Mode (Helps with connection stability)
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40005
# Logging (Optional, but good for debugging initially)
xferlog_enable=YES
Restart with sudo systemctl restart vsftpd
When setting up the camera, set the path relative to the /camera folder. e.g. Remote Directory: /doorbell (note the /)
A lot of IP cams have some "brains on board" and can at least do motion detection, then sent a frame or even a video to an FTP server or NAS. E.g. the Amcrest IPC-XD824-N which are available for very little online.
vsftpd takes up very little space or compute. Install is easy with
sudo apt install vsftpdFor a little security, we can make a user that has no rights other than to send images via FTP.
Delete everything inside (or comment it out) and paste this lean, functional configuration. This is optimized for a local network camera:
Restart with
sudo systemctl restart vsftpdWhen setting up the camera, set the path relative to the /camera folder. e.g. Remote Directory: /doorbell (note the /)