sudo apt install openssh-server
systemctl status ssh
hostname -I
ifconfig
ip a
sudo adduser ftpdrop
[sudo] password for user:
info: Adding user `ftpdrop' ...
Is the information correct? [Y/n] y
info: Adding new user `ftpdrop' to supplemental / extra groups `users' ...
info: Adding user `ftpdrop' to group `users' ...
id ftpdrop
groups ftpdrop
getent group users // show users in group
sudo deluser ftpdrop users // remove user from group
ssh-keygen -t ed25519 -f ~/ftpdrop_key
Generating public/private ed25519 key pair.
sudo mkdir /home/ftpdrop/.ssh
sudo nano /home/ftpdrop/.ssh/authorized_keys
Paste contents of /home/user/ftpdrop_key.pub
sudo chown -R ftpdrop:ftpdrop /home/ftpdrop/.ssh
sudo chmod 700 /home/ftpdrop/.ssh
sudo chmod 600 /home/ftpdrop/.ssh/authorized_keys
sudo systemctl restart ssh
"Algrotirhm Parameters EC implementation not found" on phone
ssh-keygen -t rsa -b 2048 -f ~/ftpdrop_rsa
Generating public/private rsa key pair.
sudo nano /home/ftpdrop/.ssh/authorized_keys
Paste contents of /home/user/ftpdrop_rsa.pub
sudo chown -R ftpdrop:ftpdrop /home/ftpdrop/.ssh
sudo chmod 700 /home/ftpdrop/.ssh
sudo chmod 600 /home/ftpdrop/.ssh/authorized_keys
sudo systemctl restart ssh
"Algrotirhm Parameters EC implementation not found" on phone
ssh-keygen -t rsa -b 2048 -m PEM -f ~/ftpdrop_rsa_compat
Generating public/private rsa key pair.
sudo nano /home/ftpdrop/.ssh/authorized_keys
Paste contents of /home/user/ftpdrop_rsa_compat.pub
cat ~/ftpdrop_rsa_compat.pub
sudo chown -R ftpdrop:ftpdrop /home/ftpdrop/.ssh
sudo chmod 700 /home/ftpdrop/.ssh
sudo chmod 600 /home/ftpdrop/.ssh/authorized_keys
sudo systemctl restart ssh
sudo nano /etc/ssh/sshd_config
Add at the bottom:
# Legacy key exchanges and ciphers
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
sudo systemctl restart ssh
sudo mkdir /home/ftpdrop/Videos
sudo mkdir /home/ftpdrop/Videos/cam66
sudo -u ftpdrop touch /home/ftpdrop/Videos/cam66/testfile.txt
sudo ls -al /home/ftpdrop/Videos/cam66/
sudo apt install bindfs
sudo bindfs -u ftpdrop -g user --create-with-perms=0775 /media/user/hdd/cam66/ /home/ftpdrop/Videos/cam66
Bindfs is a FUSE-based filesystem utility for Linux and macOS that mirrors a directory to another location, similar to mount --bind, but with the ability to alter file permissions, ownership, and access rights in real-time. It is commonly used to make directories read-only, share files among users without altering group settings, or modify permissions for specific processes.
Why this is good:
Zero Extra Space: It takes up 0 bytes of extra space on your OS drive.
Solves the Security Problem: You can now lock ftpdrop inside their /home folder (using "Chroot" in your FTP/SSH settings). The app thinks it’s in a safe, tiny home folder, but the heavy video files are actually landing on your big NTFS drive.
Bypasses Parent Permissions: You don't have to give the ftpdrop user access to your private /media/user/ folder anymore. They only see the "portal" in their own home.
sudo ls -ld /home/ftpdrop/Videos/cam66
drwxrwxrwx 1 ftpdrop user 12288 Jan 29 14:17 /home/ftpdrop/Videos/cam66
sudo -u ftpdrop touch /home/ftpdrop/Videos/cam66/testfile.txt
Now enter neccessary settings for SFTP in IP webcam app:
Hostname serverIP
Port 22
Username
Upload Directory
Authenticate
Save Configuration
https://www.apkmirror.com/apk/arlosoft/macrodroid-device-automation-2/macrodroid-device-automation-2-3-27-0-release/
Set a Trigger time. Set the Action: Filoader > Uploader > SFTP. Save Macros.
If IP Webcam not starting: Triggers > Device Boot, Actions > Launch IP Webcam > Force new.
If IP Webcam not recording on Android 5.1: Settings >Accessibility > MacroDroid On > Triggers > Application Launched > IP Webcam > Actions > Connectivity > Send Intent > DIDN'T WORK OUT!!!
No comments:
Post a Comment