# HG changeset patch # User Oleksandr Gavenko # Date 1463816518 -10800 # Node ID 4389c77690f6889281182f91566821ea60c27a79 # Parent 2d684ac1adf16d90a2a2d0f8f22673cf9a4f2f9f# Parent 669ef988764d92cc69856db90e98bd0b50d304f2 merged diff -r 2d684ac1adf1 -r 4389c77690f6 acl.rst --- a/acl.rst Sat May 21 00:10:10 2016 +0300 +++ b/acl.rst Sat May 21 10:41:58 2016 +0300 @@ -40,7 +40,15 @@ $ sudo setfacl -m -d u:nobody:rwx /srv/www $ sudo setfacl -m u:nobody:rwx /srv/www +or by single command:: + + $ sudo setfacl -m u:nobody:rwx,d:u:nobody:rwx /srv/www + +To apply permission recursively add ``-R`` option:: + + $ sudo setfacl -R -m -d u:nobody:rwx /srv/www + $ sudo setfacl -R -m u:nobody:rwx /srv/www + .. NOTE:: default ACL is set only on directories and is applied only to directory children. So you should explicitly add permission to directory itself! - diff -r 2d684ac1adf1 -r 4389c77690f6 ssh.rst --- a/ssh.rst Sat May 21 00:10:10 2016 +0300 +++ b/ssh.rst Sat May 21 10:41:58 2016 +0300 @@ -14,7 +14,12 @@ Maintaining key pair. ===================== -:: + +Check available key types:: + + $ ssh -Q key + +Generate keys:: $ ssh-keygen -t dsa # for DSA $ ssh-keygen -t rsa # for RSA @@ -109,8 +114,7 @@ ========================== * Install base packages and openssh. -* Set CYGWIN env var to 'binmode ntsec'. -* Create Windows user. +* Create Windows user and set its password. * Recreate /etc/passwd:: $ mkpasswd -l -u user >>/etc/passwd @@ -141,6 +145,11 @@ $ net stop sshd $ cygrunsrv -E sshd +To delete service:: + + $ cygrunsrv -E sshd + $ cygrunsrv -R sshd + If you have ``connection closed`` error check permission for ``/home/*/.ssh`` directories. If you start service from ``user`` account - add write permission to ``/home/*/.ssh``. I fix by:: @@ -148,20 +157,25 @@ $ rm -r /home/*/.ssh cmd> icacls c:\opt\cygwin\home /t /grant:r cyg_server:(f) -Запускаем SSH server на правах произвольного пользователя. ----------------------------------------------------------- +In order to enable logging from ``sshd`` uncomment in ``/etc/ssh/sshd_config``:: + + SyslogFacility AUTH + LogLevel INFO -* Создаем пользователя, например с именем user, задаем ему пароль, права (т.е. - в какие группы будет входить) и т.д., пользователя не блокируем. -* В консоле MMC добавляем оснастку "Параметры безопасности". Модифицируем - параметры: +and start syslogd from ``inetutils`` package (don't forget to restart +``sshd``!):: + + $ /bin/syslogd-config + $ net start syslogd - "Параметры безопасности" --> "Локальные политики" --> "Назначение прав - пользователя." --> "Вход в качестве службы" --> добавить 'user'. +Check ``/var/log/messages`` for logging messages. + +.. note:: + + In order to allow pubkey login and to avoid error:: - "Параметры безопасности" --> "Локальные политики" --> "Назначение прав - пользователя" --> "Отклонить локальный вход" --> удалить 'user' (если был - установлен). + userauth_pubkey: key type ssh-dss not in PubkeyAcceptedKeyTypes - XXX "Принудительное удаленное завершение." + add ``PubkeyAcceptedKeyTypes *`` or ``PubkeyAcceptedKeyTypes=+ssh-dss`` to + ``/etc/ssh/sshd_config`` but DSS keys are depricated at all.