Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use the ssh man page as a starting point for sshd_config' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use the ssh man page as a starting point for sshd_config
Authored by: cva on Feb 20, '08 05:57:56PM

I had the same problem. Then I realized that for some reason all of the \'s were missing.

Here's the diff FWIW:

cva:~ $ diff sshd_config_py.txt sshd_config.py
50c50
< pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)s{2,}(S.*)$'
---
> pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)\s{2,}(\S.*)$'
73c73
< pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)s+(.*)$'
---
> pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)\s+(.*)$'
82c82
< new[index] = '# %s %sn' % (option, value)
---
> new[index] = '# %s %s\n' % (option, value)
84c84
< new[index] += 'n%s %snn' % (option, value)
---
> new[index] += '\n%s %s\n\n' % (option, value)



[ Reply to This | # ]
Use the ssh man page as a starting point for sshd_config
Authored by: cva on Feb 20, '08 06:01:45PM

oops, looks like I missed a couple. Here's the real diff ;)

cva:~ $ diff sshd_config_py.txt sshd_config.py
50c50
< pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)s{2,}(S.*)$'
---
> pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)\s{2,}(\S.*)$'
57,58c57,58
< new.append("%sn" % option)
< new.append("# %sn" % text)
---
> new.append("%s\n" % option)
> new.append("# %s\n" % text)
73c73
< pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)s+(.*)$'
---
> pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)\s+(.*)$'
82c82
< new[index] = '# %s %sn' % (option, value)
---
> new[index] = '# %s %s\n' % (option, value)
84c84
< new[index] += 'n%s %snn' % (option, value)
---
> new[index] += '\n%s %s\n\n' % (option, value)



[ Reply to This | # ]