Hi,
I will have to login as a different user using su and run some commands.
I want to automate the following through Perl:
su - user
and provide password thru script
check if the login is successful or not.
run some commands
Can you please let me know?
Thanks in Advance.... (2 Replies)
I wanted a perl script to be done for Password search & replace in two files.
For Example:
Example 1)--i am having a file such as
cat /opt/customer/Ariba/UAT/ariba/app/buyer/Server/config/Parameters.table
Example 2)--and i am having a other file in other location such as cat... (4 Replies)
Solaris 10
Korn shell ksh,
Hi there,
I have figured out to get yesterday's date which is using the below command:
TZ=GMT+24; date +%d-%b-%Y to get the format of 30-Sep-2008 and
TZ=GMT+24; date +%Y%m%d to get the format of 20080930.
I need this two format. In my perl script below I need... (4 Replies)
Good day to all!
I'm currently doing a perl script about reading a directory.
What I'm going to do is write a script that will check whether the backup file is created daily or not inside the directory. If the backup file created, it will display "OK", else it will display the date of "no... (4 Replies)
Hi,
I have script which does the sftp function. In the script in one place it able to read the password from file and other place files with below error.
warning: has much more security than supplying the password in the clear
warning: on the command line.
Failed to get password: File... (0 Replies)
Hi Guys!
I'm currently doing a perl/bash script that will read all the partitions in the server. I'm trying to use df -h but it will just display the partitions.
Your help is very much appreciated.
Thank you. (0 Replies)
Can any body help me to find out the logic
I have a script chkcomponent.pl Which give some output
Like
component1 userid: u1
component2 userid: u2
component3 userid: u1
.
.
#The no of components are different in different times run
Now I want this chkcomponent.pl script... (1 Reply)
I have a shell script to run set of commands every week . I dont have a root access on the server but I can run the commands using pbrun
cat myscript.sh
*
*
*
pbrun command....
each time I run the script , it asks me for my password then it executes fine.
./myscript.sh
Password... (7 Replies)
Hi All,
We have many number of users.Some times we will receive mail from them like ,
the below USER password got expired and they are requesting us to change the password and send it back to them in a mail. there we are giving Expiray date again.
We are doing this process manually. I want... (2 Replies)
Hi,
I have on Designdocument in that information is stored with in tabular format.I need Perlscript to read and write the datausing perl script?
Regards,
Ravi (0 Replies)
Discussion started by: toravi.pentaho
0 Replies
LEARN ABOUT REDHAT
passwd
PASSWD(5) File formats PASSWD(5)NAME
passwd - password file
DESCRIPTION
Passwd is a text file, that contains a list of the system's accounts, giving for each account some useful information like user ID, group
ID, home directory, shell, etc. Often, it also contains the encrypted passwords for each account. It should have general read permission
(many utilities, like ls(1) use it to map user IDs to user names), but write access only for the superuser.
In the good old days there was no great problem with this general read permission. Everybody could read the encrypted passwords, but the
hardware was too slow to crack a well-chosen password, and moreover, the basic assumption used to be that of a friendly user-community.
These days many people run some version of the shadow password suite, where /etc/passwd has *'s instead of encrypted passwords, and the
encrypted passwords are in /etc/shadow which is readable by the superuser only.
Regardless of whether shadow passwords are used, many sysadmins use a star in the encrypted password field to make sure that this user can
not authenticate him- or herself using a password. (But see the Notes below.)
If you create a new login, first put a star in the password field, then use passwd(1) to set it.
There is one entry per line, and each line has the format:
account:password:UID:GID:GECOS:directory:shell
The field descriptions are:
account the name of the user on the system. It should not contain capital letters.
password the encrypted user password or a star.
UID the numerical user ID.
GID the numerical primary group ID for this user.
GECOS This field is optional and only used for informational purposes. Usually, it contains the full user name. GECOS means
General Electric Comprehensive Operating System, which has been renamed to GCOS when GE's large systems division was sold
to Honeywell. Dennis Ritchie has reported: "Sometimes we sent printer output or batch jobs to the GCOS machine. The gcos
field in the password file was a place to stash the information for the $IDENTcard. Not elegant."
directory the user's $HOME directory.
shell the program to run at login (if empty, use /bin/sh). If set to a non-existing executable, the user will be unable to
login through login(1).
NOTE
If you want to create user groups, their GIDs must be equal and there must be an entry in /etc/group, or no group will exist.
If the encrypted password is set to a star, the user will be unable to login using login(1), but may still login using rlogin(1), run
existing processes and initiate new ones through rsh(1), cron(1), at(1), or mail filters, etc. Trying to lock an account by simply chang-
ing the shell field yields the same result and additionally allows the use of su(1).
FILES
/etc/passwd
SEE ALSO passwd(1), login(1), su(1), group(5), shadow(5)
1998-01-05 PASSWD(5)