Skip to content

Commit

Permalink
install: add -with-use-dns optional argument
Browse files Browse the repository at this point in the history
it will enable UseDNS flag in sshd_config
  • Loading branch information
macno committed Jan 19, 2021
1 parent 928041e commit 89b72f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func getSshConfigs(user string, verify bool, version [2]int64) []SshConfig {
sshconfigs = append(sshconfigs, SshConfig{"PasswordAuthentication", "no"})
}

if *useDNS {
sshconfigs = append(sshconfigs, SshConfig{"UseDNS", "yes"})
}

return sshconfigs
}

Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var sshFingerprint = flag.String("fingerprint", "", "The fingerprint of the key
var cfgHostnamePrefix = flag.String("hostname-prefix", "", "Add a prefix to hostname when query server")
var cfgHostnameSuffix = flag.String("hostname-suffix", "", "Add a suffix to hostname when query server")
var passwordAuthentication = flag.Bool("with-password-authentication", false, "sshd: do not disable PasswordAuthentication (Use it only when testing!)")
var useDNS = flag.Bool("with-use-dns", false, "sshd: set UseDNS option to yes - required when using hostnames/FQDNs in AuthorizedKeys 'from' directives")

func Execute() {
flag.Usage = func() {
Expand Down

0 comments on commit 89b72f9

Please sign in to comment.