我使用的刀- vsphere插件厨师与我们的vsphere主机互动。
作为刀vsphere插件配置的一部分,您似乎必须输入一个纯文本密码,我认为这似乎是错误的。
当我在我的菜谱中设置用户时,我以前通过openssl passwd -1 "plainTextPassword"运行密码以获取哈希值,并且在创建用户时设置这个值,我不知道在节点上还是在刀中发生这种情况。
是否有人知道您是否可以使用相同的散列方法(或其他方法)在本地存储我的密码,让我登录到vsphere,还是必须将其保留为纯文本?
我当前的刀rb文件如下所示:
log_level :info
log_location STDOUT
node_name 'a-user'
client_key 'C:/Users/user/.chef/a-user.pem'
validation_client_name 'chef-validator'
validation_key 'C:/Users/user/.chef/chef-validator.pem'
chef_server_url 'https://ourChefHost01:443'
syntax_check_cache_path 'C:/Users/user/.chef/syntax_check_cache'
cookbook_path [ 'C:/Work/chef/chef-repo/cookbooks' ]
ssl_verify_mode :verify_peer
knife[:vsphere_host]="VHost"
knife[:vsphere_user]="User"
knife[:vsphere_pass]="IWantThisToBeAHashIfPossiblePlease_ThanksInAdvance!"
knife[:vsphere_dc]="Region_1"
knife[:vsphere_insecure]=false发布于 2014-12-19 21:21:26
您不能散列密码,以便以后使用该哈希登录,因为您不能检索原始值(散列是一个单向函数)。你要找的是加密。
由于knife.rb只是一个ruby文件,您还可以从环境变量(启动终端会话后必须设置一次)读取密码:
knife[:vsphere_user]="User"
knife[:vsphere_pass]=ENV['VSPHERE_PASS']这将读取您应该使用的VSPHERE_PASS变量。
export VSPHERE_PASS=mypassword据我所知,从使用厨师,没有其他方法来存储在您的机器加密(我是说..。厨师仍需能够解密)。
https://serverfault.com/questions/652990
复制相似问题