This is now solved. MaxAuthRetries was set to 1, so when the server rejected the ID, it exceeded the value. Increasing this amount so the server could procede to password interactive login worked and let me send the new keyfile to server. Thanks for all your help.