概述
1.异常提示:plaintext: the specified credentials were rejected by the server (明文:指定的凭据被服务器拒绝)
异常提示:plaintext: the specified credentials were rejected by the server (明文:指定的凭据被服务器拒绝)
解决办法:
Windows没有开启被远程管理的权限
在Windows Power Shell中执行下面命令
set-executionpolicy remotesigned
winrm quickconfig
winrm set winrm/config/service/auth ‘@{Basic=“true”}’
winrm set winrm/config/service ‘@{AllowUnencrypted=“true”}’
因为进行远程powershell管理必须需要启用winrm的服务,所以需要在windows平台上启用winrm服务
(1)winrm service 默认都是未启用的状态,先查看状态;如无返回信息,则是没有启动;
winrm enumerate winrm/config/listener
(2)针对winrm service 进行基础配置,默认的快速配置使用以下命令(含启动WinRM服务,并设置服务为自动启动):
winrm quickconfig
(3)查看winrm service listener:
winrm e winrm/config/listener
(4)为winrm service 配置auth:
winrm set winrm/config/service/auth ‘@{Basic=“true”}’
(5)为winrm service 配置加密方式为允许非加密:
winrm set winrm/config/service ‘@{AllowUnencrypted=“true”}’
注意1:
如果修改上面配后还报继续报拒绝服务凭据错误,有可能是ansible主机清单中windows服务器密码提供错误!!!!!!(大坑)
注意2:如果不设置AllowUnencrypted=“true”,走http的时候会报服务器拒绝凭证:
plaintext: the specified credentials were rejected by the server
设置为Basic=true,Basic是最低安全性的认证方式:
Basic authentication
The user name and password sent in the authentication exchange. Basic authentication can be configured to use either HTTP or HTTPS transport in a domain or workgroup. This method is the least secure method of authentication.
其他认证方式详见官方文档:Authentication for Remote Connections 及术语解释:Windows Remote Management Glossary
#下面命令可以查看winrm服务(5985端口)是否开启
netsh http show servicestate
最后
以上就是明亮酸奶为你收集整理的Ansible:部署管理windows机器遇到的问题(异常提示:plaintext: the specified credentials were rejected by the server )的全部内容,希望文章能够帮你解决Ansible:部署管理windows机器遇到的问题(异常提示:plaintext: the specified credentials were rejected by the server )所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复