I created a new user in my EC2 using:
sudo adduser test
I can add it to sudo using "usermod -aG sudo test" and verify it using "groups test", and I can "su - test" to switch to test.
However, when I tried to login this user from another host(my local MAC terminal) using:
it showed permission denied without even asking me password. ssh -v test@EC_IP shows the following log:
OpenSSH_7.4p1, LibreSSL 2.5.0 debug1: Reading configuration data /etc/ssh/ssh_config debug1: key_load_public: No such file or directory ...... debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/XXX/.ssh/id_rsa debug1: Authentications that can continue: publickey debug1: Trying private key: /Users/XXX/.ssh/id_dsa debug1: Trying private key: /Users/XXX/.ssh/id_ecdsa debug1: Trying private key: /Users/XXX/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey).
In fact, I can login a user of another host. ssh -v another@another_host showed almost the same log except two lines:
debug1: Authentications that can continue: publickey,password .... debug1: Next authentication method: password
for what reason I cannot "ssh test@EC2_IP"? why the system does not check: "debug1: Next authentication method: password"?