Answer the question
In order to leave comments, you need to log in
Mercurial-server on CentOS 6.2: how to properly set up sshd?
Good afternoon, Habrazhitel!
I install and configure Mercurial-server on Centos 6.2 according to the following manuals: habr and someone's blog .
Everything is fine, it works. But there is one caveat with configuring SSH by keys. After adding the user key to the hgadmin repository and running refresh-auth , the /var/lib/mercurial-server/.ssh/authorized_keys file is updated .
I copy this file for sshd:
cp /var/lib/mercurial-server/.ssh/authorized_keys /etc/ssh/keys/hg.pub
PubkeyAuthentication yes
AuthorizedKeysFile /etc/ssh/keys/%u.pub
ln -s /var/lib/mercurial-server/.ssh/authorized_keys /etc/ssh/keys/hg.pub
AuthorizedKeysFile /var/lib/mercurial-server/.ssh/authorized_keys
AuthorizedKeysFile ~/.ssh/authorized_keys
AuthorizedKeysFile /etc/ssh/keys/hg.pub
Answer the question
In order to leave comments, you need to log in
The answer turned out to be simple - SELinux blocked the sshd daemon from accessing the /var/lib/mercurial-server/.ssh/authorized_keys file .
You need to add the appropriate label and everything starts working:
chcon -v --type=ssh_home_t /var/lib/mercurial-server/.ssh/authorized_keys
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question