Перечитал кучу информации, в том числе статью достопочтенного Манефесто http://www.lissyara.su/articles/freebsd ... tosis_ssh/.
- Поставил git,
- поставил gitosis,
- создал пользователя git,
- зашел под пользователем git (su git)
- создал ssh ключ (ssh-keygen)
- выполнил инициализацию gitosis (gitosis-init < .ssh/id_rsa.pub)
в /home/git/.ssh/authorized_keys :
Код: Выделить всё
### autogenerated by gitosis, DO NOT EDIT
command="gitosis-serve git@youserv",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB....... git@youserv
- .gitosis.conf :
Код: Выделить всё
[gitosis]
[group gitosis-admin]
members = git@youserv
writable = gitosis-admin
Код: Выделить всё
#echo 'git_daemon_enable="YES"' >> /etc/rc.conf
#echo 'git_daemon_flags="--syslog --base-path=/home/git/repositories \
--export-all --detach"' >> /etc/rc.conf;
- Захожу с другого терминала под пользователем user, предварительно взяв секретный ключ id_rsa.
- пытаюсь выполнить:
Код: Выделить всё
ssh git@youserv -i /home/user/.ssh/id_rsa
Код: Выделить всё
Permission denied (publickey).
Код: Выделить всё
$ ssh -Tv git@youserv -i /home/user/.ssh/id_rsa
OpenSSH_6.1p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to youserv [youserv] port NN.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1_hpn13v11
debug1: match: OpenSSH_6.1_hpn13v11 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.1_hpn13v11 FreeBSD-20120901
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA <вырезал>
debug1: Host '[youserv]:NN' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/user/.ssh/id_rsa':
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).