Inside the LXC container, use the root user to create a non-root user. In this example the user is added to the sudo and docker groups after installing Docker inside the LXC container.
Terminal window
useradd-s/bin/bash-m-Gsudo,dockerismael
Change the user password as needed.
Terminal window
suismael
passwd
This user’s default UID:GID will be 1000:1000. If not, create it with:
Take note of this UID:GID as it will be used to map the share in Proxmox. The share itself can live on another system; here an unRAID VM on the same host is used.
If at some point Proxmox loses connectivity with an SMB/CIFS share, it will not restore the connection by itself until a restart of the Proxmox node is performed.
With the script below, the Proxmox node restores the connection automatically.
On the node’s shell, create a bash script that looks for mount points in /mnt/pve/ and unmounts them if they become stale:
Terminal window
nanoremount.sh
Put this content into the file:
#!/bin/bash
list=$(ls/mnt/pve)
foriin$list
do
status=$(ls/mnt/pve/$i2>&1)
if [[ $status=~ .*Stale.* ]]
then
umount/mnt/pve/$i
fi
done
Remember to make the script executable by the user creating it:
Terminal window
chmod766/root/remount.sh
Add a cron job for this script to run automatically:
Terminal window
***** /root/remount.sh >/dev/null 2>&1
With that, any SMB/CIFS connections are restored automatically. That is because the service pvestatd tries to remount every SMB share every 10 seconds.
This approach could work for NFS shares too, but that possibility has not been tested.
Linux-to-Linux SSH setups are straightforward, but the Windows OpenSSH client needs a different approach to copy a generated key for password-less logins.
Generate your private and public keys in your Windows PowerShell shell
The command below performs the equivalent of ssh-copy-id using the OpenSSH client on Windows. Edit user@host.address with the remote user and host IP/hostname.