Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Created September 26, 2013 23:23
Show Gist options
  • Save AlainODea/6722007 to your computer and use it in GitHub Desktop.
Save AlainODea/6722007 to your computer and use it in GitHub Desktop.
Configure SmartOS Global Zone (GZ) for SSH public key-only access
#!/bin/bash
# clumsiness due to my inability to get sed -i working in the GZ (BSD sed)
tempfile=$(tempfile)
cat /usbkey/ssh/sshd_config | sed 's/PasswordAuthentication yes/PasswordAuthentication no/' > $tempfile
cat $tempfile /usbkey/ssh/sshd_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment