This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sat:ssh_key [2023/01/25 21:42] – removed - external edit (Unknown date) 127.0.0.1 | sat:ssh_key [2023/06/10 11:19] (current) – olaf | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== OpenHDF 6.x/7.x SSH and SFTP access with key files ====== | ||
+ | |||
+ | |||
+ | To control a Linux server with SSH, it is more secure to use an encrypted key to authenticate than a simple password. That’s also the case for file transfers – especially since SSH and SFTP server can share the same secret. | ||
+ | |||
+ | The OpenHDF image contains already a tiny SSH server: dropbear. For SFPT we need to add the openSSH SFTP server from the OpenHDF repository. Connect as root on the box and install it: | ||
+ | |||
+ | <code bash> | ||
+ | opkg update | ||
+ | opkg install openssh-sftp-server | ||
+ | </ | ||
+ | |||
+ | if it doesn’t exist, create a directory .ssh in the home of the user you use to connect to the box. | ||
+ | |||
+ | '' | ||
+ | |||
+ | I am using PuTTYgen to generate the public and private key | ||
+ | You can download PuttyGen (and other Putty stuff) from https:// | ||
+ | |||
+ | Start PuTTYgen in a command shell as Administrator. | ||
+ | |||
+ | Select Type of key to generate to EdDSA and curve to use Ed25519 | ||
+ | |||
+ | Under Key in the menu select '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | I set the Key comment to something like ''< | ||
+ | |||
+ | Click '' | ||
+ | |||
+ | Copy the content of '' | ||
+ | |||
+ | In your terminal on the box just generate the file in '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | paste the content of '' | ||
+ | |||
+ | Now, we need to modify the parameters in putty to use the key: | ||
+ | |||
+ | Set the user under '' | ||
+ | {{: | ||
+ | |||
+ | Then open the connection. You’ll be asked for the passphrase for the key and then the session connects. | ||
+ | In your SFTP client you can change now the protocol to SFTP, provide the private key and after providing the passphrase it connects to the box. | ||
+ | |||
+ | Now, the dropbear configuration could be changed to only allow root with keys and/ or access only with key. | ||
+ | |||
+ | Modify / | ||
+ | |||
+ | Original : | ||
+ | * DROPBEAR_EXTRA_ARGS=" | ||
+ | No passwords: | ||
+ | * DROPBEAR_EXTRA_ARGS=" | ||
+ | |||
+ | The parameters for DROPBEAR_EXTRA_ARGS: | ||
+ | * Allow blank passwords: -B | ||
+ | * Generate hostkeys automatically: | ||
+ | * Disable password logins for root: -g | ||
+ | * Disable password logins: -s | ||