Bug 2320 - end-of-line comments work in sshd_config but not in ssh_config
Summary: end-of-line comments work in sshd_config but not in ssh_config
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.7p1
Hardware: Other Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_8_5
  Show dependency treegraph
 
Reported: 2014-11-23 05:58 AEDT by philcerf
Modified: 2023-01-13 13:27 AEDT (History)
2 users (show)

See Also:


Attachments
Strip comments from ssh config files (878 bytes, patch)
2014-12-23 15:23 AEDT, Damien Miller
no flags Details | Diff
Strip comments from ssh config files (931 bytes, patch)
2020-11-30 13:46 AEDT, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description philcerf 2014-11-23 05:58:00 AEDT
Dear OpenSSH developers.

I just found out that end-of-line comments, e.g.
AllowUser foo   #bar baz
seem to work in sshd_config, but they don't in ssh_config.
Having them in the later gives some error like:
$ ssh host
/etc/ssh/ssh_config line 23: garbage at end of line; "#bar".


In fact there seems to be code to search for left-over config line content in both, the parsers for ssh_config and sshd_config, it only seems to work for the former.

While it would be *very* nice to have end-of-line comments, there may be a bug hidden somewhere in servconf.c, that end-of-line comments ("the garbage") aren't noted in sshd_config.


Regards,
Philippe
Comment 1 Damien Miller 2014-12-23 15:23:13 AEDT
Created attachment 2519 [details]
Strip comments from ssh config files
Comment 2 Darren Tucker 2020-11-30 13:46:40 AEDT
Created attachment 3460 [details]
Strip comments from ssh config files

Update patch to -current
Comment 3 Darren Tucker 2020-11-30 16:37:43 AEDT
Patch has been applied and will be in the 8.5 release.  Thanks for the report.
Comment 4 Damien Miller 2021-03-04 09:52:51 AEDT
close bugs that were resolved in OpenSSH 8.5 release cycle