salt-ssh '*' [ options ] sys.doc

salt-ssh -E '.*' [ options ] sys.doc cmd


Salt SSH allows for salt routines to be executed using only SSH for transport


-r, --raw, --raw-shell

Execute a raw shell command.


Specify the SSH private key file to be used for authentication.


Define which roster system to use, this defines if a database backend, scanner, or custom roster system is used. Default is the flat file roster.


Define an alternative location for the default roster file location. The default roster file is called roster and is found in the same directory as the master config file.

2014.1.0 新版功能.

--refresh, --refresh-cache

Force a refresh of the master side data cache of the target's data. This is needed if a target's grains have been changed and the auto refresh timeframe has not been reached.


Set the number of concurrent minions to communicate with. This value defines how many processes are opened up at a time to manage connections, the more running process the faster communication should be, default is 25.

-i, --ignore-host-keys

Disables StrictHostKeyChecking to relax acceptance of new and unknown host keys.


Fully ignores ssh host keys which by default are honored and connections would ask for approval. Useful if the host key of a remote server has changed and would still error with --ignore-host-keys.


Set the default password to attempt to use when authenticating.


Set this flag to attempt to deploy the authorized ssh key with all minions. This combined with --passwd can make initial deployment of keys very fast and easy.





-h, --help


-c CONFIG_DIR, --config-dir=CONFIG_dir

Salt配置目录的位置。这个目录包含了Salt Master和Minion的配置文件。在大多数系统中,默认位置是``/etc/salt``。


-E, --pcre

目标表达式会当作PCRE正则表达式而不是一个shell 通配符

-L, --list


-G, --grain

目标表达式匹配值返回minion的Salt grains系统。目标表达式是这样格式'<grain value>:<glob expression>'; 比如:'os:Arch*'



minion上的Salt grains系统返回的目标表达式匹配值。目标匹配值是像这样的格式 '<grain value>:< regular expression>';;例如: 'os:Arch.*'

-N, --nodegroup

使用在Salt master配置文件中定义的预定义复合目标。

-R, --range





-l LOG_LEVEL, --log-level=LOG_LEVEL

控制台日志级别。是``all``, garbage, trace, debug, info, warning, error, ``quiet``的其中一个。默认|loglevel|.




Logfile 记录的日志级别。是``all``, garbage, trace, debug, info, warning, error, ``quiet``其中一个。默认: warning.



Pass in an alternative outputter to display the return of data. This outputter can be any of the available outputters:

grains, highstate, json, key, overstatestage, pprint, raw, txt, yaml

Some outputters are formatted only for data returned from specific functions; for instance, the grains outputter will not work for non-grains data.

If an outputter is used that does not support the data passed into it, then Salt will fall back on the pprint outputter and display the return data using the Python pprint standard library module.


If using --out=json, you will probably want --static as well. Without the static option, you will get a separate JSON string per minion which makes JSON output invalid as a whole. This is due to using an iterative outputter. So if you want to feed it to a JSON parser, use --static as well.

--out-indent OUTPUT_INDENT, --output-indent OUTPUT_INDENT

Print the output indented by the provided value in spaces. Negative values disable indentation. Only applicable in outputters that support indentation.

--out-file=OUTPUT_FILE, --output-file=OUTPUT_FILE







When using colored output the color codes are as follows:

green denotes success, red denotes failure, blue denotes changes and success and yellow denotes a expected future change in configuration.


salt(7) salt-master(1) salt-minion(1)