云上不要禁用密码复杂度,禁用了会有坑,什么坑就不说了,肯定是安全的坑。
server系统本来默认就是开启密码复杂度,但PC系统默认是关闭的,这就被我发现坑了,如果你在云上使用win7、win10等,一定要开启密码复杂度。
如何查询密码复杂度是否开启?以管理员身份打开cmd命令行执行如下命令
secedit /export /cfg c:\secpol.cfg
echo. >c:\out.txt
type c:\secpol.cfg | findstr -i complex >>c:\out.txt
type c:\out.txt
如果结果为PasswordComplexity = 1,代表密码复杂度已开启
如果结果为PasswordComplexity = 0,代表密码复杂度未开启
如果想要禁用密码复杂度,以管理员身份打开cmd命令行执行如下命令
secedit /export /cfg c:\secpol.cfg
echo. >c:\out.txt
type c:\secpol.cfg | findstr -i complex >>c:\out.txt
powershell -command "(GC C:\secpol.cfg) -Replace \"PasswordComplexity = 1\",\"PasswordComplexity = 0\" | Out-File C:\secpol.cfg"
echo. >>c:\out.txt
type c:\secpol.cfg | findstr -i complex >>c:\out.txt
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
del /q c:\secpol.cfg
type c:\out.txt
del /q c:\out.txt
del %windir%\security\logs\scesrv.log
如果要开启密码复杂度,以管理员身份打开cmd命令行执行如下命令
secedit /export /cfg c:\secpol.cfg
echo. >c:\out.txt
type c:\secpol.cfg | findstr -i complex >>c:\out.txt
powershell -command "(GC C:\secpol.cfg) -Replace \"PasswordComplexity = 0\",\"PasswordComplexity = 1\" | Out-File C:\secpol.cfg"
echo. >>c:\out.txt
type c:\secpol.cfg | findstr -i complex >>c:\out.txt
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
del /q c:\secpol.cfg
type c:\out.txt
del /q c:\out.txt
del %windir%\security\logs\scesrv.log
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。