ssh.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1858 c6dc48292ee8
child 1904 78357d58b7ab
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
     1
.. -*- coding: utf-8; -*-
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
     2
.. include:: HEADER.rst
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
===========
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 SSH/sshd.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
===========
1032
4decc3e00bb6 Fix coding and contents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1002
diff changeset
     7
.. contents::
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
1385
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
     9
Debugging ssh client.
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
    10
=====================
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
    11
::
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
    12
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
    13
  $ ssh -vvv ...
acb36dfe5d09 Debugging ssh client.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1384
diff changeset
    14
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
Maintaining key pair.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
=====================
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
  $ ssh-keygen -t dsa     # for DSA
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
  $ ssh-keygen -t rsa     # for RSA
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
  $ ssh-keygen -t dsa -C comment     # put own comment instead user@host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
  $ ssh-keygen -t dsa -f my_dsa_key  # store priv key under my_dsa_key
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
                                     # and pub key under my_dsa_key.pub
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
1626
73fa021859e7 recover pub key from priv
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1595
diff changeset
    25
  $ ssh-keygen -y -f ~/.ssh/id_dsa >~/.ssh/id_dsa.pub  # recover pub key from priv
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  $ ssh-keygen -p -N "newphrase" -P "oldphrase" -f ~/.ssh/id_dsa
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
                                     # change passphrase of priv key
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
1858
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    30
Coping and deleting public keys.
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    31
================================
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    32
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    33
To copy your public key to remote host (for automatic login by pubkey
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    34
authentication)::
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    35
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
  $ ssh $user@$host cat ">>" "~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
                                     # public pub key on remote host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
1595
7f512266d262 ssh-copy-id
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1386
diff changeset
    39
  $ ssh-copy-id  $user@$host         # alternative to previous command
7f512266d262 ssh-copy-id
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1386
diff changeset
    40
1858
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    41
To remove ``known_hosts`` key (usually need if you change server pubkey or
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    42
change server)::
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    43
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    44
  $ ssh-keygen -R hostname
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    45
  $ ssh-keygen -R hostname -f ~/.ssh/known_hosts
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    46
c6dc48292ee8 Coping and deleting public keys.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1680
diff changeset
    47
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
Shell login.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
============
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
  $ ssh $user@$host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
  $ ssh $user@$host:$port
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
  $ ssh -i ~/.ssh/my_dsa_key $user@$host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
or::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
  $ ssh -l $user $host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
  $ ssh -l $user $host:$port
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
1384
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    62
X11 forwarding.
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    63
===============
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    64
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    65
Enable X11 forwarding on remote host in ``~/.ssh/config`` or ``/etc/ssh_config``::
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    66
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    67
  X11Forwarding yes
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    68
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    69
then login to this host by::
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
  $ ssh -X $user@$host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
1384
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    73
or by using trusted X11 forwarding::
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    74
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    75
  $ ssh -Y $user@$host
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    76
1386
864237ce5f1b X11Forwarding does not work with OpenSSH under Cygwin
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1385
diff changeset
    77
See:
864237ce5f1b X11Forwarding does not work with OpenSSH under Cygwin
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1385
diff changeset
    78
864237ce5f1b X11Forwarding does not work with OpenSSH under Cygwin
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1385
diff changeset
    79
  http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-ssh-no-x11forwarding
864237ce5f1b X11Forwarding does not work with OpenSSH under Cygwin
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1385
diff changeset
    80
                X11Forwarding does not work with OpenSSH under Cygwin
1384
9698523dd263 X11 forwarding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1383
diff changeset
    81
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
Multiply private keys.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
======================
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
ssh try use all listen keys::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
  $ ssh -i ./priv1 -i ./priv2 $user@$host
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
or place in ~/.ssh/config::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
  Host *
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
  IdentityFile ~/.ssh/identity # standard search path for protocol ver. 1
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
  IdentityFile ~/.ssh/id_dsa   # standard search path for RSA key protocol ver. 2
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
  IdentityFile ~/.ssh/id_rsa   # standard search path for DSA key protocol ver. 2
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
  IdentityFile ~/.ssh/my_dsa
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
  IdentityFile ~/.ssh/another_dsa
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
or per host private key::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
  Host host1                   # alias, that user provide at CLI
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
  HostName host1.example.com   # real host name to log into
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
  User iam
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
  IdentifyFile ~/.ssh/iam_priv_dsa
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
  Host host2                   # alias, that user provide at CLI
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
  HostName 192.168.1.2         # real host IP to log into
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
  User admin
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
  IdentifyFile ~/.ssh/admin_priv_dsa
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
Installing sshd on Cygwin.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
==========================
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
 * Install base packages and openssh.
1382
9297a8f7e3f3 Fix: CYGWIN=tty is no longer supported.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   113
 * Set CYGWIN env var to 'binmode ntsec'.
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
 * Create Windows user.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
 * Recreate /etc/passwd::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
     $ mkpasswd -l -u user >>/etc/passwd
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
   or::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
     $ mkpasswd -l >/etc/passwd
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
  * Register sshd::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
     $ mkdir -p /home/user
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
     $ ssh-host-config -y
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
  * Start::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
     $ net start sshd
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
    or::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
     $ cygrunsrv -S sshd
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
 * Check from remote host::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
     $ ssh $gygwin_host -l user
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   130
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   131
To stop service use::
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   133
  $ net stop sshd
1680
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   134
  $ cygrunsrv -E sshd
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   135
1680
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   136
If you have ``connection closed`` error check permission for ``/home/*/.ssh``
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   137
directories. If you start service from ``user`` account - add write permission
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   138
to ``/home/*/.ssh``. I fix by::
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   139
1680
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   140
  $ rm -r /home/*/.ssh
826133768ee5 connection closed fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1626
diff changeset
   141
  cmd> icacls c:\opt\cygwin\home /t /grant:r cyg_server:(f)
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
Запускаем SSH server на правах произвольного пользователя.
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
----------------------------------------------------------
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
1383
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   146
 * Создаем пользователя, например с именем user, задаем ему пароль, права (т.е.
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   147
   в какие группы будет входить) и т.д., пользователя не блокируем.
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   148
 * В консоле MMC добавляем оснастку "Параметры безопасности". Модифицируем
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   149
   параметры:
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
1383
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   151
     "Параметры безопасности" --> "Локальные политики" --> "Назначение прав
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   152
     пользователя." --> "Вход в качестве службы" --> добавить 'user'.
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   153
1383
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   154
     "Параметры безопасности" --> "Локальные политики" --> "Назначение прав
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   155
     пользователя" --> "Отклонить локальный вход" --> удалить 'user' (если был
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   156
     установлен).
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   157
1383
a9febd006f66 Fix styles.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1382
diff changeset
   158
     XXX "Принудительное удаленное завершение."
1002
234cd58cae56 Fix RTS syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   159