I’m currently trying to setup key authentication with ssh, which works. All the .ssh files are being copied from /shares/Volume_1/Nas_Prog/.ssh/ to /home/root/ (for persistent changes after reboot). Then I wanted to disable password authentication in the sshd_config file located at /etc/ssh/, so I also created that file at the /shares/Volume_1/Nas_Prog/ location and copied that with an init.sh script to the corresponding directories (in order to only allow key authentication). Now I’m facing the problem that any changes I make to the sshd_config file don’t apply. My guess is that the ssh service is being started before I copied the custom sshd_config file from /shares/… to /etc/… so the changes don’t apply. Then I tried to restart the ssh/ shhd service via command line in order to apply those changes, but I couldn’t figure out how to do that, I tried the following commands:
sudo service ssh restart / sudo service sshd restart results in: service: command not found
sudo systemctl ssh restart / sudo systemctl ssh restart results in: systemctl: command not found
/etc/init.d/ssh restart / /etc/init.d/sshd restart results in: /etc/… not found
I would appreciate any further ideas on how to restart the ssh service or apply changes to the sshd_config file.
Further informations:
Firmware version: 2.31.204
sshd_config:
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_rsa_key
SyslogFacility AUTHPRIV
AllowUsers sshd
PermitRootLogin yes
PubKeyAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication no
ChallengeResponseAuthentication no
TCPKeepAlive yes
#PubkeyAcceptedKeyTypes +ssh-dss
HostKeyAlgorithms +ssh-dss
Ciphers +blowfish-cbc
MaxAuthTries 5
Subsystem sftp /usr/bin/sftp-server
AuthorizedKeysFile /home/root/.ssh/authorized_keys