Setup Mac for ssh into synology
Jump to navigation
Jump to search
Set up Password-less Login
For an unattended script, your Mac needs to log in without a password. Open Terminal on your Mac: Generate a key:
ssh-keygen -t ed25519 (Press Enter through all prompts).
Copy it to the NAS:
ssh-copy-id -i ~/.ssh/id_ed25519.pub your_nas_user@100.x.y.z
Test it:
ssh your_nas_user@100.x.y.z. If you get in without a password, you’re ready.
Fix Permissions on the Synology
Log in to your NAS with your password one last time and run these commands to restrict access to your home folder: Set Home Directory to 755: SSH requires that your home directory is not writable by others.
chmod 755 /volume1/homes/bacchas
Set .ssh Folder to 700: This folder must be readable only by you.
chmod 700 /volume1/homes/bacchas/.ssh
Set authorized_keys to 600: The key file must be strictly protected.
chmod 600 /volume1/homes/bacchas/.ssh/authorized_keys
Create config file
Create a config file in the ~/.ssh/config This file contains the host name and the path to the ssh keys
Host wendy
HostName 192.168.20.22
User myname
IdentityFile ~/.ssh/keyidfile
IdentitiesOnly yes
#for tailscale
Host wendy-tailscale
HostName 1.1.1.1
User myname
IdentityFile ~/.ssh/keyfile
IdentitiesOnly yes