使用Saltstack的ssh模块实现key的集中式管理 [salt.modules.ssh]

简介:

如题:


使用saltstack的ssh模块进行key的集中管理


saltstack ssh

salt-ssh

saltstack key


http://rfyiamcool.blog.51cto.com/1030776/1305710


salt-key

SYNOPSIS

salt-key [ options ]

DESCRIPTION

Salt-key executes simple management of Salt server public keys used for authentication.

OPTIONS

--version

Print the version of Salt that is running.

--versions-report

Show program's dependencies and version number, and then exit

-h, --help

Show the help message and exit

-c CONFIG_DIR, --config-dir=CONFIG_dir

The location of the Salt configuration directory. This directory contains the configuration files for Salt master and minions. The default location on most systems is /etc/salt.

-q, --quiet

Suppress output

-y, --yes

Answer 'Yes' to all questions presented, defaults to False

Logging Options

Logging options which override any settings defined on the configuration files.

--log-file=LOG_FILE

Log file path. Default: /var/log/salt/minion.

--log-file-level=LOG_LEVEL_LOGFILE

Logfile logging log level. One of allgarbagetracedebuginfowarningerrorquiet. Default: warning.

Output Options

--out

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

grainshighstatejsonkeyoverstatestagepprintrawtxtyaml

Some outputters are formatted only for data returned from specific functions; for instance, the grainsoutputter 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 pprintoutputter and display the return data using the Python pprint standard library module.

Note

If using --out=json, you will probably want --static as well. Without the static option, you will get a JSON string for each minion. 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

Write the output to the specified file.

--no-color

Disable all colored output

--force-color

Force colored output

Actions

-l ARG, --list=ARG

List the public keys. The args preun, and unaccepted will list unaccepted/unsigned keys. acc or accepted will list accepted/signed keys. rej or rejected will list rejected keys. Finally, all will list all keys.

-L, --list-all

List all public keys. (Deprecated: use --listall)

-a ACCEPT, --accept=ACCEPT

Accept the specified public key (use --include-all to match rejected keys in addition to pending keys). Globs are supported.

-A, --accept-all

Accepts all pending keys.

-r REJECT, --reject=REJECT

Reject the specified public key (use --include-all to match accepted keys in addition to pending keys). Globs are supported.

-R, --reject-all

Rejects all pending keys.

--include-all

Include non-pending keys when accepting/rejecting.

-p PRINT, --print=PRINT

Print the specified public key.

-P, --print-all

Print all public keys

-d DELETE, --delete=DELETE

Delete the specified key. Globs are supported.

-D, --delete-all

Delete all keys.

-f FINGER, --finger=FINGER

Print the specified key's fingerprint.

-F, --finger-all

Print all keys' fingerprints.

Key Generation Options

--gen-keys=GEN_KEYS

Set a name to generate a keypair for use with salt

--gen-keys-dir=GEN_KEYS_DIR

Set the directory to save the generated keypair. Only works with 'gen_keys_dir' option; default is the current directory.

--keysize=KEYSIZE

Set the keysize for the generated key, only works with the '--gen-keys' option, the key size must be 2048 or higher, otherwise it will be rounded up to 2048. The default is 2048.


还是那样,有时间写~



 本文转自 rfyiamcool 51CTO博客,原文链接:http://blog.51cto.com/rfyiamcool/1300204,如需转载请自行联系原作者


相关文章
|
7月前
|
Linux 网络安全 开发工具
百度搜索:蓝易云【Git安装 + 多站点SSH Key配置教程。】
现在,你已经成功安装了Git,并配置了多站点的SSH Key。你可以使用Git命令进行版本控制,并通过SSH Key进行身份验证来访问不同的Git仓库。
154 0
|
9月前
|
网络安全 开发工具 数据安全/隐私保护
解决 Enter passphrase for key ‘/Users/dzm/.ssh/id_rsa‘:
解决 Enter passphrase for key ‘/Users/dzm/.ssh/id_rsa‘:
729 0
|
2天前
|
算法 网络安全
no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 问题解决
【5月更文挑战第8天】no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 问题解决
12 0
|
5天前
|
算法 网络安全
Unable to negotiate with 127.0.0.1 port 29215: no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 解决
【5月更文挑战第5天】Unable to negotiate with 127.0.0.1 port 29215: no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 解决
21 7
|
13天前
|
弹性计算 运维 Shell
基于key验证多主机ssh访问
【4月更文挑战第30天】
22 1
|
14天前
|
监控 前端开发 安全
【专栏】介绍了前端工程师如何掌握SSH命令,包括SSH协议的基础知识、命令行操作如登录、文件传输、目录管理和进程管理
【4月更文挑战第29天】本文介绍了前端工程师如何掌握SSH命令,包括SSH协议的基础知识、命令行操作如登录、文件传输、目录管理和进程管理。在前端开发中,SSH用于部署项目、协同后端开发及服务器监控。文章还强调了使用密钥认证、配置别名及安全注意事项,并提醒开发者面对问题时如何解决。学习和熟练运用SSH是前端工程师适应复杂项目需求的关键。
|
2月前
|
存储 弹性计算 算法
SSH学习(三)- SSH协议中的Public Key Algorithm
在SSH协议中,有两个地方涉及到公钥算法,分别是: 1. 服务端认证:服务端在进行密钥协商的时候证明自己身份,防止中间人攻击,此时为SSH-TRANS协议发生的事情; 2. 客户端认证:客户端通过PublicKey方式证明自己身份,完成SSH登录认证,此时SSH-USERAUTH发生的事情; 这两种情况下的公钥算法使用的是同一个概念,接下来本文将主要基于PublicKey公钥认证方式,学习对应的内容。
59 1
SSH学习(三)- SSH协议中的Public Key Algorithm
|
3月前
|
网络安全 数据安全/隐私保护
如何使用ssh key免密码登录服务器?
如何使用ssh key免密码登录服务器?
|
3月前
|
监控 安全 网络安全
局域网管理监控的远程访问控制:利用SSH和Python实现安全管理
在当今数字化时代,局域网管理监控对于确保网络安全至关重要。远程访问控制是一项关键任务,通过利用SSH(Secure Shell)和Python编程语言,我们可以实现更加安全的管理方法。本文将介绍如何使用这两者结合,为局域网管理提供可靠的远程访问控制。
197 1
|
9月前
|
安全 网络协议 Linux
Linux SSH:安全远程访问与管理
SSH(Secure Shell)是一种网络协议,广泛应用于Linux系统中,用于在不安全的网络中进行安全的远程访问和管理。SSH协议通过加密和身份认证机制,确保数据传输的安全性和用户身份的可靠性。本文将深入探讨Linux下的SSH协议,包括工作原理、配置、密钥认证、安全性措施以及实际应用等,帮助读者充分了解SSH的重要性,并学会在Linux系统中正确使用SSH实现安全远程访问和管理。
305 0