本文介绍: 通过SecureCRT 或者 xshellssh终端工具软件连接VCSA67,默认端口22,直接用root账号 和 原始密码可以登录进去:一种情况会直接提示要求修改密码,按照提示提示完成新密码设置即可;正常部署完VMWARE的VCSA后,如果没有修改root密码策略或者root密码没有定期修改时间长了在登录管理页面时也会报如下错误。出现上面的错误后不处置,在升级VCSA6.7时,也会提示如下报错报错内容也是root密码过期了,导致无法进行正常的升级。2.3 恢复远程登录权限登录验证
1. 问题的出现

正常部署完VMWARE的VCSA后,如果没有修改root密码策略或者root密码没有定期修改时间长了在登录管理页面时也会报如下错误

在这里插入图片描述

出现上面的错误后不处置,在升级VCSA6.7时,也会提示如下报错报错内容也是root密码过期了,导致无法进行正常的升级

Appliance (OS) root password expired.

Please change appliance (OS) root password before attempting an update

2. 解决办法

2.1 开启sshbash shell登录权限

打开VCSA控制台选择Troubleshooting Mode Options开启sshbash shell

在这里插入图片描述

在这里插入图片描述

注意此处两项都回车选择一下,看到Disable就表示当前已是开启状态,无需保存,即时生效

在这里插入图片描述

在这里插入图片描述

2.2 修改root账号密码策略

通过SecureCRT 或者 xshellssh终端工具软件连接VCSA67,默认端口22,直接用root账号 和 原始密码可以登录进去:一种情况会直接提示要求修改密码,按照提示提示完成新密码设置即可;还有一种情况会不提示更新密码,登录进去需手动输入passwd命令进行修改,下面是第二种情况的修改过程

#### 然后通过SecureCRT 或者 xshellssh终端工具软件连接VCSA67,默认端口22,直接填写root 和 老密码登录进去。
#### 有时也登录后会看到修改密码的提示,先输入老的密码,再输入新的密码,如果没提示就用下面的命令修改root密码
VMware vCenter Server Appliance 6.7.0.41000
 
Type: vCenter Server with an embedded Platform Services Controller
 
Connected to service
 
    * List APIs: "help api list"
    * List Plugins: "help pi list"
    * Launch BASH: "shell"
Command> shell
Shell access is granted to root
 
########################################################################################
## 基本用法
1 chage -M -1 -E -1 root    # 设置root用户的密码永不过期命令两个参数数字1不是小写字母l;
2 chage -l root             # 查看root用户信息;
########################################################################################
 
 
root@vcsa-ip250 [ <sub> ]# chage -help
Usage: chage [options] LOGIN
 
Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximum number of days before password
                                change to MAX_DAYS
  -R, --root CHROOT_DIR         directory to chroot into
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
 
##  直接修改root 密码永久有效会报错,因为密码已经过期了
root@vcsa-ip250 [ </sub> ]# chage -I -1 -m 0 -M 99999 -E -1 root
You are required to change your password immediately (root enforced)
chage: PAM: Authentication token is no longer valid; new one required
 
## 命令方式修改root密码
root@vcsa-ip250 [ <sub> ]# passwd root
New password:                   #注意新的密码不能和老的密码相似度太高,也不能太简单,否则修改不了,
Retype new password: 
passwd: password updated successfully
 
## 最后执行chage命令,将root密码设置永不过期。
root@vcsa-ip250 [ </sub> ]# chage -I -1 -m 0 -M 99999 -E -1 root
root@vcsa-ip250 [ ~ ]#
 
## 查看修改后的账号过期信息
root@vcsa-ip250 [ ~ ]# chage -l root
Last password change                                    : May 21, 2022
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
root@vcsa-ip250 [ ~ ]#

2.3 恢复远程登录权限并登录验证

设置完成后,记得关闭Shell、SSH登录权限,确保系统安全

在这里插入图片描述

此时再执行VCSA升级操作或者用root账户登录管理页面都不会报错了,也不会再提示这类密码过期了。

原文地址:https://blog.csdn.net/ichen820/article/details/129548637

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_31696.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注