Fixed SSH bad permissions.
This commit is contained in:
@@ -70,10 +70,8 @@ necessary_credentials_with_config() {
|
||||
setup_ssh() {
|
||||
echo -e "\n\n ✅ Generating new SSH for numbus-admin..."
|
||||
mkdir -p extra-files/home/numbus-admin/.ssh/
|
||||
ssh-keygen -t "ed25519" -C "numbus-admin@numbus-server" -f "extra-files/home/numbus-admin/.ssh/id_ed25519" -N "" -q
|
||||
chmod 700 extra-files/home/numbus-admin/.ssh/
|
||||
chmod 600 extra-files/home/numbus-admin/.ssh/id_ed25519
|
||||
chmod 644 extra-files/home/numbus-admin/.ssh/id_ed25519.pub
|
||||
ssh-keygen -t "ed25519" -C "numbus-admin@numbus-server" -f "extra-files/home/numbus-admin/.ssh/id_ed25519" -N "" -q
|
||||
|
||||
REMOTE_PASS=$(gum input --password --placeholder "Enter password for 'nixos' on '$TARGET_HOST'")
|
||||
if [ -z "$REMOTE_PASS" ]; then
|
||||
@@ -81,7 +79,7 @@ setup_ssh() {
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\n\n ➡️ Copying SSH key to target host 'nixos@$TARGET_HOST'..."
|
||||
if sshpass -p "$REMOTE_PASS" ssh-copy-id -o StrictHostKeyChecking=no -i "extra-files/home/numbus-admin/.ssh/id_ed25519.pub" "nixos@$TARGET_HOST"; then
|
||||
if sshpass -p "$REMOTE_PASS" ssh-copy-id -o StrictHostKeyChecking=no -i "extra-files/home/numbus-admin/.ssh/id_ed25519" "nixos@$TARGET_HOST"; then
|
||||
echo " ✅ SSH key copied successfully."
|
||||
else
|
||||
echo " ❌ Failed to copy SSH key. Please check the host IP and password."
|
||||
@@ -91,7 +89,7 @@ setup_ssh() {
|
||||
}
|
||||
|
||||
ssh_to_host() {
|
||||
ssh -i "extra-files/home/numbus-admin/.ssh/id_ed25519.pub" "nixos@$TARGET_HOST" "$1"
|
||||
ssh -i "extra-files/home/numbus-admin/.ssh/id_ed25519" "nixos@$TARGET_HOST" "$1"
|
||||
}
|
||||
|
||||
hardware_detection() {
|
||||
|
||||
Reference in New Issue
Block a user