The way a simple SSH command work is as follows:
ssh user_name@host
If you omit user_name
and just run ssh host
it will assume that you mean the same user that is currently logged in to your machine. Let's say your login is jdoe, then it will become equivalent to ssh jdoe@host
.
Please note that the user that you are logging in as must be a valid user to be logged on to that computer. With some exceptions, that probably do not apply in this case, you should be able to go to that machine and log in locally by using that particular user name and the password that you have entered.
If you control both machines and wish to create a user on the remote one, you need to run:
sudo adduser user_name
Just change user_name to the name that you wish your user to be, once again if that is jdoe you would type sudo adduser jdoe
. You will be asked for password, name of the user, etc.
Alternatively you can use useradd
command, but it is a lower level command, and should probably be avoided. Especially if other stuff that i wrote here sounds new to you.
There is no need to create the home directory yourself, it will be created for you.
ssh
to a remote computer asexample1
user but you know that on the remote computer there is noexample1
user? Then it obviously won't work.