By default, Augeas loads all the files it knows about, which can be quite slow.
To prevent this, your command uses --noautoload
which bypasses automatically loading files from lenses. While this makes Augeas much faster, it also means it doesn't know about /etc/ssh/sshd_config
anymore, so you need to map this file to the Sshd.lns
lens manually again, which is done with --transform Sshd.lns incl /etc/ssh/sshd_config
.
Here is another possibility (from augeas-sandbox) to load any file known to Augeas and bypass other lenses:
#!/bin/shFILE=$1if [ -z "$FILE" ]; then echo "Usage: $0 <FILE>" exit 1fiaugtool -L -i <<EOFrm /augeas/load/*["$FILE"!~glob(incl) or "$FILE"=~glob(excl)]loadset /augeas/context /files$FILEEOF
This script will use autoload statements so you don't have to specify which lens to use, but it will only load the lens you want for your file, making Augeas faster. Additionally, it sets /augeas/context
, so you can use relative paths:
$ augloadone /etc/ssh/sshd_configrm : /augeas/load/*["/etc/ssh/sshd_config"!~glob(incl) or "/etc/ssh/sshd_config"=~glob(excl)] 1158augtool> ls .