I know, I'm an idiot, I have no backups, let's move forward. Is there any way I can get the files off the SD card? I did
sudo chmod 777 / -R and can no longer connect to the device over SSH or SFTP.
Oh Man, what a screw up.Do you have any other access to the device?
In all honesty I would mount drive on another computer, copy important files and reinstall.
Unfortunately Many things in linux are picky about permissions, SSH is probably among the pickiest.
To restore only SSH/SFTP, you can start by correcting permissions for private and public keys under the sshd directory.
chmod -R 644 /etc/ssh chmod 600 /etc/ssh/*_key
That is, folder, configs and public keys get set to
644 and private keys to
If you are using key authentication, the same must be done for user config and key files under
Otherwise, you may attempt to reinstall all packages using dpkg
This is taken from a unix.se answer. Note just like the author of that answer, I did not test this sequence.
dpkg --get-selections > selections sudo dpkg --clear-selections sudo dpkg --set-selections < selections sudo apt-get --reinstall dselect-upgrade