0

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.

  • 1
    Have you tried mounting the sd card on another system? – Quintin Balsdon Oct 27 '17 at 6:49
1

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 600

If you are using key authentication, the same must be done for user config and key files under $HOME/.ssh/


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.