If your web site is using the new infrastructure, then you must login to the control panel before you are able to SSH or SFTP to your site.
If you are using automated scripts that rely on passwordless SSH keys to copy files to your site, you can still manage this automatically.
Below is a sample script you can use to programatically log in to the control panel prior to running an automated script using your SSH keys:
#!/bin/bash
# Log into red control panel to establish two factor auth for ssh/sftp purposes.
# Pass one argument, which is the path to a file with the contents of your username
# and password separated by a colon, e.g.:
# USERNAME:PASSWORD
! which curl >/dev/null && printf "Please install curl.\n" && exit 1
! which jq >/dev/null && printf "Please install jq.\n" && exit 1
url=https://members.mayfirst.org/cp/api.php
password_file="$1"
if [ -z "$password_file" ]; then
printf "Please pass the path to your password file as the first argument.\n"
exit 1
fi
if [ ! -f "$password_file" ]; then
printf "Cannot find password file: %s.\n" "$password_file"
exit 1
fi
user=$(cat "$password_file" | cut -d: -f1)
password=$(cat "$password_file" | cut -d: -f2)
if [ -z "$user" -o -z "$password" ]; then
printf "Failed to locate user and password in password file.\n"
exit 1
fi
out=$(curl --silent "${url}" -X POST -d "user_name=$user" -d "user_pass=$password" -d "action=grant")
exit=$(echo "$out" | jq .is_error)
if [ "$exit" != "0" ]; then
echo "$out" | jq
exit 1
fi
exit 0