I want someone from windows to log in into my server using SSH, so he can edit files and install things. Is there a step to step how to do it? I need to:

  1. Create his user account.
  2. Configure it, giving him access to a single folder and nothing else (how?)
  3. Generate a public key for him on Windows (how?)
  4. Add his public key to authorized_keys correctly.
  5. Tell him the command he needs to use to actually log in from Window's terminal.

I pretty much only know how to create the account. How to accomplish the latter steps?

  • What OS does your server run? Which distribution in case of Linux? Why do you want to use SSH instead of something like (S)FTP? What do you mean by "installing things"? – michas Feb 23 '14 at 23:29
  • note: this is about to be put on hold as too broad. this is because you should split this up into multiple questions; as it is, this contains no single, actionable problem. – strugee Feb 24 '14 at 5:51
  • @strugee We'll see. How many questions do you want this to make? 2–4 ist just one: "How to configure sshd?" – Hauke Laging Feb 24 '14 at 7:00
  • @HaukeLaging ...which would be closed as too broad. ultimately, asking multiple questions in one post is bad. either the additional questions should be consolidated or they should be removed (and then posted separately). – strugee Feb 25 '14 at 2:07

(2) You may configure sshd to chroot() for this user. See man 5 sshd_config, search for ChrootDirectory and ForceCommand.

(3) You must create a key pair. The public key is used on the server, the private key is used by the client. See ssh-keygen. You may need ssh-keygen -e ... for converting the key so that it is usable by putty but maybe putty can do this conversion itself meanwhile.

(4) This is basically adding a line to a text file:

cat public_key_file >>/path/to/authorized_keys

(5) Your user will have to download the Windows SSH program putty and configure it to use the private key you supplied.

Not the answer you're looking for? Browse other questions tagged or ask your own question.