Implement password and key authentication