After installing two VMs in VirtualBox, I tried to connect them, using ssh protocol from the client machine (with openssh-client installed) to the ssh server machine (with openssh-server installed). Both of machines are in a Host Only Network (named: vboxnet0). When I try, from the client (named: sshclient), to open a ssh connection on the server (named: sshserver and with IP address:192.168.56.3), I get the message: Permission denied, please try again. I typed:ssh sshclient@sshserver -p 22
and typed the password (correctly, I am sure) 3 times. The port 22 was enabled on the server configuration file /etc/ssh/sshd_config
, the PasswordAuthentication line was uncommented and the IP address of the client was added in the file /etc/hosts
on server side.
What is happened? Any tips to solve?
Thanks a lot.
Since the client is unable to even attempt to connect to the server try
netstat -tln
on the server. It sounds like it doesn't have port 22 open for some reason.If :22 isn't listed then try restarting the ssh service.
Also when attempting to connect to a server via ssh the user portion (before the '@' needs to be a user that is on the server. It sounds like you are trying to use the user from the sshClient to login to the sshServer, when in reality this doesn't make sense.
For example: Let us say that The sshServer has a user ExtraUser and the sshClient has a user Karen. If Karen wants to ssh into the server she will need to type
ssh ExtraUser@sshServer
. This will have her login to the sshServer as ExtraUser, not as Karen. This is important because Karen's user account/permissions is located on the sshClient not the sshServer.