标签归档:密码

centos7进入单用户模式修改密码的办法

启动linux,在这个界面时,按e,

按向下的箭头键,在linux16这一行的末尾LANG=en_US.UTF-8后面输入init=/bin/sh

然后按ctrl+x,进入单用户模式

此时在单用户模式下还不能修改密码,需要输入命令mount -o remount,rw /

然后通过passwd修改root密码,修改完成后,一定要输入touch /.autorelabel,不然启动不了

输入 touch /.autorelabel后输入exec /sbin/init即可使用刚才修改的root密码进入系统

深信服VSSL管理员密码恢复的办法

对于硬件SSL VPN设备,可以通过U盘来恢复admin的密码,大概方法是将U盘格式化成FAT32分区,新建reset-password.txt文件,插入设备,重启设备,等设备重启完成后,拔下U盘查看是否生成reset-password.log文件,如果生成则恢复成功,有时候需要多试几次才会恢复成功。

但是对于VSSL,即虚拟化的VPN,截止最新的769R1版本,都不支持这种方式(虚拟机挂载U盘)来恢复密码。

如果要恢复VSSL的管理员密码,一般可以通过将VSSL的虚拟磁盘挂载到linux虚拟机上,然后查看ctrl_user.sfr,路径是/config/etc/sangfor/或者/sftmpfs/etc/sangfor/,这两个路径下的ctrl_user.sfr保存的密码是一样的,但是admin密码加密过了,可以联系深信服厂家人员解密。

配置备份文件里也会保存admin密码,如果有配置备份文件,也可以将配置文件交给深信服厂家获取admin密码。

vSphere 6.5密码重置(vCenter, SSO and ESXi)

Everyone knows the situation where you can’t log into a system because you have forgotten the password. The following article explains how to reset the password and regain access to VMware vSphere 6.5 core components including vCenter, SSO and ESXi Hosts.

  • Reset vCenter Server Appliance 6.5 root password
  • Reset SSO Administrator Password (vCenter Server Appliance 6.5)
  • Reset ESXi root password with Host Profiles
  • Gain Administrative ESXi access with an Active Directory
  • Reset ESXi root password (Linux Live CD)

Reset vCenter Server Appliance 6.5 root password

The following method provides steps to recover the vCenter Server Appliance (vCSA) root password. The process is slightly different compared to previous versions as the OS has been changed to PhotonOS. The method is officially supported by VMware and documented in KB2147144.

  1. Take a snapshot of the vCSA to be able to rollback in case of any problems during password recovery.
  2. Connect to the ESXi Host that runs the vCSA and open a remote console.
  3. Reboot the vCSA
  4. Press e immediately after the system starts (When the PhotonOS screen shows up)
  5. Append rw init=/bin/bash to the line starting with linux

  6. Press F10 to boot
  7. In the command prompt, enter passwd and enter a new root password twice
  8. Enter umount / to unmount the root filesystem
  9. Reboot the vCSA by running the command reboot -f
  10. Verify that you can log in with the new root password and delete the snapshot created in step 1.

 

Reset SSO Administrator Password (vCenter Server Appliance 6.5)

The following method provides steps to recover the SSO administrator password on a vCenter Server Appliance (vCSA). The method is officially supported by VMware and documented in KB2146224.

  1. Log in to the vCSA using SSH as root
  2. Enter shell to start the bash shell
  3. Identify the SSO Domain Name (Default is vsphere.local)
    # /usr/lib/vmware-vmafd/bin/vmafd-cli get-domain-name --server-name localhost

  4. Start the vdcadmintool

    # /usr/lib/vmware-vmdir/bin/vdcadmintool
  5. Press 3 (Reset account password)
  6. The tool asks for the Account UPN to reset. Enter Administrator@<DOMAIN> (identified in Step 3)
  7. The tool generates and displays a new password.
  8. Use the password to log in with the vSphere Web Client and change the password.

 

Reset ESXi root password with Host Profiles

According to VMware KB1317898, “reinstalling the ESXi host is the only supported way to reset a password on ESXi”. However, there is a loophole as you can set the root password with Host Profiles under certain conditions. This method has two requirements:

  • The ESXi hosts needs to be managed by a vCenter
  • vSphere Enterprise Plus License is required to use Host Profiles

The vCenter uses a vpxuser to communicate with ESXi hosts, so it does not depend on the root account. As long as the ESXi host is managed by the vCenter, you can change the configuration without knowing the ESXi root password. This method works with all ESXi 5.x and 6.x versions.

  1. Create a Host Profile with the ESXi you want to reset the root password as reference Host
    Web Client > Right-Click the ESXi Host > Host Profiles > Extract Host Profile…
  2. Navigate to the Host Profile and select Actions > Edit Settings…
  3. Navigate to the root User Configuration
    Security and Services > Security Settings > Security > User Configuration > root
  4. Set the Password configuration to Fixed password configuration and enter a new password.
  5. Click Finish to close the profile configuration
  6. Right-Click the Host Profile and select Attach/Detach Hosts and Clusters…
  7. Highlight the ESXi host, Click Attach > and finish the configuration screen

  8. Put the ESXi host into maintenance mode
  9. Right-Click the ESXi host and select Host Profiles > Remediate…
  10. Finish the remediation wizard. The remediation should take less than a minute, no reboot is required.
  11. Use the new root password to login

 

Gain Administrative ESXi access with an Active Directory

When you don’t have the Enterprise Plus license, you can join an Active Directory to regain administrative access to the ESXi host. This method circumvents the limitation that root PW recovery is not supported.

  1. Login to the vCenter with the vSphere Web Client
  2. Navigate to ESXi > Configure > System > Authentication Services
  3. Click Join Domain…
  4. Enter the domain name and user credentials
  5. Click OK
  6. In the ESXi configuration, open System > Advanced System Settings
  7. Enter Config.HostAgent.plugins.hostsvc.esxAdminsGroup in the search field
  8. Change the settings to match the Administrator group that you want to use in the Active Directory. You can either create a new group in your direcotry or enter an existing group

 

Reset ESXi root password (Linux Live CD)

When you need to recover root access and the methods above are not applicable, the last method explains how to reset the root password with a Linux Live CD. Please be aware that this method is not supported by VMware as KB1317898 states: “reinstalling the ESXi host is the only supported way to reset a password on ESXi”. You can use any current Linux Live CD or installer CD that has a recovery mode. In this example I’m using Knoppix.

  1. Shutdown the ESXi host
  2. Boot the system with the Linux Live CD
  3. Make sure that you can read the gpt partition table, for example with parted /dev/sda print
  4. We are looking for the first fat16 partition with a size of 262MB. IT should be number 5.
  5. Mount the partition
    # mount /dev/sda5 /media/sda5
  6. Verify that there is a current state.tgz in the directory.
  7. # ls -l /media/sda5/state.tgz

  8. The state.tgz file contains the local.tgz file which contains the configuration. Extract both to a temporary directory.
    # cd /tmp/
    # cp /media/sda5/state.tgz /tmp/state.tgz
    # tar -xf state.tgz
    # tar -xf local.tgz
  9. Edit the shadow file and remove the root password
    # vi etc/shadow

    Remove the hashed password until the second colon:

    You want a file that looks like this:

  10. Save the file and exit the editor (<ESC> :wq <ENTER>)
  11. Recreate state.tgz with the changed shadow file
    # tar -czf local.tgz etc
    # tar -czf state.tgz local.tgz
  12. Move state.tgz back to ESXi partition and make sure to overwrite the old file
    # mv state.tgz /media/sda5/
  13. Reboot to ESXi. You should be able to access the DCUI or log in as root without a password.

重置windows版本vcenter6.5管理员密码的方法

现有一个windows版本的vcenter6.5管理员密码丢失,我们可以使用vmware的工具vdcadmintool,在命令行进入到vdcadmintool所在的目录,然后执行下vdcadmintool,出现下列菜单:

输入3,重置账号密码,然后输入之前配置的管理员账号,此处为Administrator@vsphere.local,会自动生成新密码,打开https://vcenter-ip/vsphere-client/,即可使用新密码登录。

重置IBM刀片服务器的管理模块

IBM刀片服务器管理模块有一个重置按钮,可以通过使用重置按钮来重置管理模块将其恢复到出厂设置。

IBM刀片管理模块重置按钮如下:
IBM重置管理口
可通过环形针来使用这个重置按钮。

这个重置按钮主要有两个作用:
1、重置管理口的网络配置,操作方法为按住重置按钮3秒(或3秒以内)
2、重置整个管理模块,包括网络配置及用户名、密码,操作方法为按住重置按钮5秒,释放重置按钮并等5秒,按住重置按钮10秒。

重置网络配置后,默认管理模块是采用DHCP,主机名是MMxxxx,xxxx是管理口的MAC地址,这个MAC地址印在重置按钮下方。如果没有DHCP服务器,那么管理口默认使用192.168.70.125,子网掩码为255.255.255.0,主机名也是MMxxxx。

重置用户名和密码后,用户名和密码都会恢复出厂设置,用户名为USERID,都是大写字母,密码为PASSW0RD,倒数第三位是数字0,其余为大写字母。

 

使用Windows 2008操作系统安装盘破解管理员用户密码的方法

很多人都遇到密码忘记的问题,对于windows 2000操作系统来说,只需要删除SAM文件即可。对于windows xp、windows 2003、windows 7、windows 2008等操作系统,只需要在winpe环境下(前提是能识别到硬盘)使用ntpwedit和passrenew这两个软件即可。

本文介绍使用操作系统安装盘来破解管理员用户密码的方法。具体操作步骤如下:

1、使用操作系统安装盘引导启动,进入安装语言选择界面,按shift+F10,会弹出命令行界面。

2、将system32目录下的osk.exe文件删除,命令为:
D:\>del 系统盘/windows/system32/osk.exe

3、将cmd.exe替换osk.exe,命令如下:
D:\Windows\System32>copy cmd.exe osk.exe

4、退出命令行界面,重启,取出安装盘,进入提示输入ctrl+alt+del的图形界面时,点击左下角的轻松访问按钮,勾选”不使用键盘键入(屏幕键盘)“,确定后弹出命令行界面。

5、使用命令建立user1用户,密码abc#123,然后将该用户加入管理员组,命令为:
C:\Windows\system32>net user user1 abc#123 /add
C:\Windows\system32>net localgroup administraotrs user1 /add

6、退出命令行后,即可使用user1登录操作系统,由于该用户有管理员权限,可以更改Administrator用户的密码,使用Administrator用户登录后,再从其他windows 2008操作系统上将osk.exe覆盖用cmd.exe替换的osk.exe。即还原了原操作系统。步骤完成。