HG-SSH(8)
π HG-SSH(8) β the Mercurial Manual, bestie edition π¦
okay so you're reading the hg-ssh page from the Mercurial Manual, and honestly? it's giving "tiny script, huge power". let's get into it β¨
πΈ NAME πΈ
hg-ssh β a restricted ssh login shell for Mercurial, no cap π
π SYNOPSIS π
hg-ssh repositories...
π DESCRIPTION π
hg-ssh is a wrapper for ssh access to a limited set of mercurial repos. that's it, that's the vibe β it's the bouncer at the club door, and the club is your repositories π«Ά
To be used in ~/.ssh/authorized_keys with the "command" option, see sshd(8):
command="hg-ssh path/to/repo1 /path/to/repo2 ~/repo3 ~user/repo4" ssh-dss ...
and ngl, you probably want these other useful options riding along too: no-port-forwarding, no-X11-forwarding, no-agent-forwarding. they're the "and also pls don't do weird stuff" clause π₯
This allows pull/push over ssh from/to the repositories given as arguments. the args ARE the guest list, fr fr.
If all your repositories are subdirectories of a common directory, you can allow shorter paths with:
command="cd path/to/my/repositories && hg-ssh repo1 subdir/repo2"
You can use pattern matching of your normal shell, e.g.:
command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
and yes bestie, the globs go crazy πβ¨
You can also add a --read-only flag to allow read-only access to a key, e.g.:
command="hg-ssh --read-only repos/*"
read-only is lowkey the safest main character energy β look, don't touch π
π BUGS π
Probably lots. not gonna lie to you. please post them to the mailing list (see Resources below) when you find them π
β SEE ALSO β
π AUTHOR π
Written by Olivia Mackall <olivia@selenic.com> π
π RESOURCES π
- Main Web Site:
https://mercurial-scm.org/ - Source code repository:
https://www.mercurial-scm.org/repo/hg - Mailing list:
https://www.mercurial-scm.org/mailman/listinfo/mercurial/
π COPYING π
Copyright (C) 2005-2016 Olivia Mackall. Free use of this software is granted under the terms of the GNU General Public License version 2 or any later version. π
π§ AUTHOR π§
Thomas Arendsen Hein <thomas@intevation.de>
- Organization: Mercurial
that's the whole page, bestie! go forth and gatekeep your repos responsibly πβ¨
this lil masterpiece is from the Mercurial Manual β page HG-SSH(8), and it's served up fresh for you. mwah π
π«Ά
π¦ where this page comes from
- alpine 3.24: mercurial-doc 7.2.4-r0 Β· GPL-2.0-or-later
- arch rolling: mercurial 7.2.4-1 Β· GPL
- debian bookworm: mercurial-common 6.3.2-1+deb12u1 Β· GPL-2.0-or-later
- epel 10: mercurial 6.8.1-2.el10_0 Β· GPL-2.0-or-later
- epel 9: mercurial 6.1.4-1.el9 Β· GPLv2+
- fedora 43: mercurial 7.1.1-1.fc43 Β· GPL-2.0-or-later
- fedora 43: mercurial 7.1.1-2.fc43 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2-1.fc44 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2.4-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: mercurial 7.1.2
- nixos 26.05: mercurial-full 7.1.2
- nixpkgs unstable: mercurial 7.2.2
- nixpkgs unstable: mercurial-full 7.2.2
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- ubuntu jammy: mercurial-common 6.1.1-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: mercurial-common 6.7.2-1ubuntu2 Β· GPL-2.0-or-later
- ubuntu noble: mercurial-common 6.7.2-1ubuntu2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms