- Code: Select all
import crypt
import os
import getpass
def set_node_password():
while(1):
pass1 = getpass.getpass()
pass2 = getpass.getpass(prompt = 'Confirm Password: ')
if pass1 != pass2:
print 'The passwords you entered did not match! Please try again.'
elif len(pass1) < 6:
print 'Password length must be atleast 6 characters! Please try again.'
else:
break
f=open('/etc/vkarma/passwd', 'w')
f.write(crypt.crypt(pass1, 'BK'))
f.close()
os.chmod('/etc/vkarma/passwd', 0400)
if __name__ == '__main__':
set_node_password()
Once you download it, please rename it to nodepassreset.py and run like this:
- Code: Select all
wget http://www.fluidvm.com/downloads/nodepassreset.txt
mv nodepassreset.txt nodepassreset.py
python nodepassreset.py