Auto mount with SSHFS no SSH key

teodreams

New Member
Feb 27, 2025
1
0
1
Hi, I mounted a folder present in my nas server to my proxmox server with SSHFS

Code:
sshfs user@nas_ip:/path/to/nas_folder /mnt/proxmox_folder

Afterwards I was asked for the password of (user@nas_ip)

But if I restart my proxmox server I should manually mount the nas. I'll start by saying that I'm a beginner, but is there a way to automate this? I would like that as soon as I start the proxmox server the nas is mounted and if for some reason it were to disconnect, it reconnects by itself. Also I can't use an ssh key because I can't do it with my nas, thanks.
 
First guess:
Code:
~# apt show sshpass

Description: Non-interactive ssh password authentication
 SSH's (secure shell) most common authentication mode is called "interactive
 keyboard password authentication", so called both because it is typically
 done via keyboard, and because openssh takes active measures to make sure
 that the password is, indeed, typed interactively by the keyboard. Sometimes,
 however, it is necessary to fool ssh into accepting an interactive password
 non-interactively. This is where sshpass comes in.
 .
 SECURITY NOTE: There is a reason openssh insists that passwords be typed
 interactively. Passwords are harder to store securely and to pass around
 securely between programs. If you have not looked into solving your needs
 using SSH's "public key authentication", perhaps in conjunction with the ssh
 agent (RTFM ssh-add), please do so before being tempted into using this
 package.

Disclaimer: not tested by me - I am used to handle ssh-keys with ssh-agent.