Expansion for user keyword in ssh_config

Brian Candler b.candler at pobox.com
Mon Sep 7 03:09:54 AEST 2026


On 06/09/2026 17:56, list at moeller-mail.eu wrote:
> On an older Linux I get
>
> ssh -G 192.168.1.2
> host 192.168.1.2
> user piAAA%n

Thank you for the clear platform comparison, with all the version 
numbers included. That makes it fairly certain that the feature was 
introduced in OpenSSH >9.5 <=10.0

The release notes are pretty easy to find: 
https://www.openssh.org/releasenotes.html

Scanning through this, the release notes for OpenSSH 10.0/10.0p2 
(2025-04-09) say:

  *ssh(1) <https://man.openbsd.org/ssh.1>: allow %-token and environment variable expansion in
    the ssh_config User directive, with the exception of %r and %C
    which would be self-referential.bz#3477 <https://bugzilla.mindrot.org/show_bug.cgi?id=3477>

Therefore the answer is: upgrade to 10.0 or later if you want this feature.


More information about the openssh-unix-dev mailing list