I recently got a UniFi UNAS-Pro and I’m in the process of setting up passwordless SSH access for easier administration. On other UniFi devices (UXG-Pro, UDM, etc.), there’s usually a spot in the UI to upload an SSH public key via the controller (Settings → System → SSH Authentication), but I can’t find any such option for the UNAS-Pro.
I’d like to know: is it safe/acceptable to manually add my SSH key to the UNAS-Pro?
Has anyone done this and had it persist across reboots or firmware updates?
I added my key and so far it has remained through updates. What are you trying to do from the command line that you can’t do vi the web UI?
I wrote a script to automatically retrieve SMART data from the HDDs. The reason is that the NAS is installed in a location that can get quite warm during the summer, and I want to keep a closer eye on drive temperatures and overall health. Doing this over SSH is much quicker and easier for me than logging into the web UI each time.
The script looks like this:
#!/bin/bash
Configuration
REMOTE_USER=root
REMOTE_HOST=192.168.11.3
DISKS=(“/dev/sda” “/dev/sdb” “/dev/sdc” “/dev/sdd”)
OUTPUT_FILE=“$HOME/Desktop/smart_data_$(date +%Y-%m-%d).log”
Clear the output file
“$OUTPUT_FILE”
Loop through each disk and fetch SMART data
for DISK in “${DISKS[@]}”; do
echo “===== SMART data for $DISK =====” >> “$OUTPUT_FILE”
ssh “${REMOTE_USER}@${REMOTE_HOST}” “sudo smartctl -a $DISK” >> “$OUTPUT_FILE”
echo -e “\n\n” >> “$OUTPUT_FILE”
done
echo “SMART data saved to: $OUTPUT_FILE”