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 🌈


πŸ“ 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 πŸ’…πŸ«Ά