VMware Cloud Community
CuriSys92
Contributor
Contributor
Jump to solution

Need to alter a /etc/pam.d/password file but would like to use PowerCLI

So we need to add these to that /etc/pam.d/password file but across multiple hosts using PowerCLI or some other scripting language if PowerCLI won't work.  But I saw there was a thread where you can add in a local root user (https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Need-Help-in-creating-admin-user-on-mu...) so thinking this would be possible.

Steps:

1. Login in as root to multiple hosts

2. Locate the /etc/pam.d/passwd

3. Add this line to the end of that file and save:

password requisite /lib/security/$ISA/pam_passwdqc.so retry=N min=N0,N1,N2,N3,N4

 

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can use the Posh-SSH module to logon, via SSH, to an ESXi node.
Then you can execute a command on that ESXi node.
See for example my Use Posh-SSH instead of PuTTY dive.

You have to have the SSH service running on the ESXi node of course.

With the sed command you can easily add a line to a file.

sed '$ a Your new line' /etc/pam.d/password


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

You can use the Posh-SSH module to logon, via SSH, to an ESXi node.
Then you can execute a command on that ESXi node.
See for example my Use Posh-SSH instead of PuTTY dive.

You have to have the SSH service running on the ESXi node of course.

With the sed command you can easily add a line to a file.

sed '$ a Your new line' /etc/pam.d/password


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
CuriSys92
Contributor
Contributor
Jump to solution

Thank LucD!!

Tags (1)
0 Kudos