0

The connection to SSH seems to work but I get an error and SSH gets closed instantly: It tells me, that it cant chdir to /home/example1 not found The problem is, that example1 isn't even a user and even if I create that folder it says it can't find it.

this is pretty annoying as I can't find a way to fix it. Why does SSH want to use a home directory which isn't even there? I'm logged in as example2.

2
  • I don't understand. You are trying to ssh to a remote computer as example1 user but you know that on the remote computer there is no example1 user? Then it obviously won't work.
    – falconer
    Dec 13, 2013 at 15:03
  • Please edit your question and post how you try to login with ssh Dec 13, 2013 at 15:10

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .