Pages

Wednesday, November 28, 2018

Ansible :How to reset user password in Linux servers

How to reset user password in Linux servers

1) Generate the encryted password and enter required password. It will generate encrypted password, which we have to use in below playbook.

# python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())"
password ...

Note the encryption for below playbook.

2) Put ecrypted password in playbook

--- # This is to reset password of account 'Sitadmin' on Linux servers
- hosts: password_reset_servers
  user: Account
  become: yes
  connection: ssh
  tasks:
  - name: Change Sitadmin password
    user: name=Sitadmin update_password=always  password=$6$rounds=656000$DFemtIsZ.6q0F5$dJGl7/vJs4bYsSlEo64.fQKGgpwwzunFvPj5QChPZslV49b4Swex8TFmud9jbCNseHO.eySszUHLzkhn7/K0e1

Monday, November 12, 2018

Extending the root disk in AWS servers


extending the root disk in AWS servers

1) Create snapshot for root disk from AWS console
2) Create the volume from snapshot
3) Attach the Volume to server as extra disk ( Note: You can extend the size of volume at this point if needed )
4) Mount the volume on server
   mount -t xfs -o nouuid /dev/xvdh2 /mnt     

5) Verify the right disk added
6) unmount /mnt
6 ) parted -a optimal /dev/xvdh
    < print >
    < unit GB >
    < resizepart <No> >
    < Size wants to be >
    < print >
    < quit >

7) Mount the volume on server
   mount -t xfs -o nouuid /dev/xvdh2 /mnt
           
8) xfs_growfs /mnt
           
9) verify the file system with size (df -Ph )
10) unmount the file system
11) Shut down the server
12) Detach the extended volume & root volume from Instance
13) Attach the extended volume as root volume to instance
14) Boot the Instance
15 ) Verify the root file system size.

Ansible :How to reset user password in Linux servers

How to reset user password in Linux servers 1) Generate the encryted password and enter required password. It will generate encrypted pas...