As part of trying to implement a security measure in my root ssh session, I'm trying to devise a method of starting a script after n seconds of root user login, and change the user password and logout the user automatically.
I'm getting stuck at trying to change the password silently.
okay here I go again...
I have created a script which adds new user to /etc/password and which inturn creating a locked password in /etc/shadow but I am expecting to have *NP* for that particular user.Can someone help me with a script which can set the password for a particular user to NP in /etc/shadow..Thanks
---------- Post updated 07-31-12 at 01:11 AM ---------- Previous update was 07-30-12 a
After run my script, i am giving my password as input to script.
First script validates if my given password is correct and then script should start remaining process
In my script.
echo -n "Enter Password: "
stty -echo
read passwd
stty echo
#Here i want to evaluate $passwd having corresponding user's system password or not
# <Then some process start>
I am user xyz on redhat linux VM abc.
I cannot change password.
abc:/home/xyz>passwd
Changing password for user xyz.
Changing password for xyz
(current) UNIX password:
Password changes on the command line are not supported.
Hello,
I have a python script (not created by me), let's call it myscript, which I call with several parameters. If I don't provide the --password parameter, the script will ask the user to input the password.
So I run the script like this:
Code:
/wherever/myscript --username=whoever /some/other/path/parameter
That makes it ask for a password and wait for user input.
I created a script wherein it will change password of a user
Quote:
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "New UNIX password:"
send "$password\r"
expect "Retype new UNIX password:"
send "$password\r"
Hi All,
I am working on a Solaris 10 machine and now working with a user creation script.
Hi Dears,
I have one script to create new users with information in one plain text file.
I came across this script a while back that i found. What i want to do is edit the script to create a default web page in /var/www/html when a new user is added through the script. What the script does now is adds a user and sets a password for the user.
What possible way (either through a combination of python or c or some other language) could i add to the shell script to do this?