Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need output in one line and filter servers, which has account expired or password exipred Post 303039860 by RudiC on Wednesday 16th of October 2019 01:01:32 PM
Old 10-16-2019
Added file "servers.txt" to read from.

Try
Code:
while read server
   do   sshpass -p 'abc' ssh -o StrictHostKeyChecking=no -q -t xyz@${server} awk -v"HN=$(hostname)" '/[mM]inimum/ {next} /PASS_MIN_LEN/{print HN, $2}'  /etc/login.defs`
   done < servers.txt

Read from input file!

Last edited by RudiC; 10-16-2019 at 04:36 PM..
 

9 More Discussions You Might Find Interesting

1. AIX

AIX Non Expired Password

Hi, I am into production support and handling some of the AIX servers. We are planning to have a user id on a AIX system with non-expired password. Now the question is that if I have a non expired password then I cannot do a interactive login to AIX machine ( i:e cannot do Telnet ,SSH etc)... (0 Replies)
Discussion started by: siddhhuu
0 Replies

2. UNIX for Dummies Questions & Answers

prompting for account that expired

I have this problem. Two accounts in an aix. Account A expired and it would auto prompt for new password when the user failed to log in, but Account B would not prompt for the new password. Instead it will only display "your account is expired. Please contact your administrator". I would like to... (1 Reply)
Discussion started by: mayyap
1 Replies

3. UNIX for Advanced & Expert Users

Root account is expired

Hi all, I am using redhat linux version 9 .I am unable to login to the system and i am getting a warninig sorry root account is expired . How can i activate the account. (2 Replies)
Discussion started by: mallesh
2 Replies

4. Solaris

expired root password

We have expiration set on the root password for 30 days. the only way to login as root remotley is login as another user and then su as root. I logged in to the machine today tried to su as root, and got the message password has expired, use passwd to change but i cant get in as root.. If... (1 Reply)
Discussion started by: csaunders
1 Replies

5. AIX

HMC User account expired - What now?

I've created an hmc user account for our developers and set a pawword expiry to 30 days. Trouble is when the password expires they are asked to change it in the WebSM gui but it returns an error "XXXX check log file /var/websm/data/....log" which doesn't exist. I've tried resetting the password... (0 Replies)
Discussion started by: backslash
0 Replies

6. UNIX for Dummies Questions & Answers

How to reactivate expired account in Linux as a root user

I am an administrator of a Red Hat Enterprise Linux system. Now one account expired. I wonder how to reactivate the account. Thanks (2 Replies)
Discussion started by: cy163
2 Replies

7. UNIX for Advanced & Expert Users

password expired

Hi When i try to login with my username/password i get the following message 'Password for user 'lmathew' has expired - use passwd(1) to update it' please let me know what to do Thanks in advane Ammu (2 Replies)
Discussion started by: ammu
2 Replies

8. Solaris

Never Expired for root password

Never expired for root password Guy's I want to change the setting to keep the root password to be nerved expired! Please advice with the sitting! (9 Replies)
Discussion started by: top.level
9 Replies

9. Solaris

Solaris 11 user account login expired

Hi everyone Please i need urgent help... I have installed solaris 11 using live media.. then i installed sunray.. every thing is fine.. but after system reboot i am unable to login on server on GUI it gives account expired error or some time authentication failed... but i can log in through... (11 Replies)
Discussion started by: amk
11 Replies
SSHPASS(1)							Sshpass User Manual							SSHPASS(1)

NAME
sshpass - noninteractive ssh password provider SYNOPSIS
sshpass [-ffilename|-dnum|-ppassword|-e] [options] command arguments DESCRIPTION
This manual page documents the sshpass command. sshpass is a utility designed for running ssh using the mode referred to as "keyboard-interactive" password authentication, but in non- interactive mode. ssh uses direct TTY access to make sure that the password is indeed issued by an interactive keyboard user. Sshpass runs ssh in a dedicated tty, fooling it into thinking it is getting the password from an interactive user. The command to run is specified after sshpass' own options. Typically it will be "ssh" with arguments, but it can just as well be any other command. The password prompt used by ssh is, however, currently hardcoded into sshpass. Options If no option is given, sshpass reads the password from the standard input. The user may give at most one alternative source for the pass- word: -ppassword The password is given on the command line. Please note the section titled "SECURITY CONSIDERATIONS". -ffilename The password is the first line of the file filename. -dnumber number is a file descriptor inherited by sshpass from the runner. The password is read from the open file descriptor. -e The password is taken from the environment variable "SSHPASS". SECURITY CONSIDERATIONS
First and foremost, users of sshpass should realize that ssh's insistance on only getting the password interactively is not without reason. It is close to impossible to securely store the password, and users of sshpass should consider whether ssh's public key authentication pro- vides the same end-user experience, while involving less hassle and being more secure. The -p option should be considered the least secure of all of sshpass's options. All system users can see the password in the command line with a simple "ps" command. Sshpass makes a minimal attempt to hide the password, but such attempts are doomed to create race conditions without actually solving the problem. Users of sshpass are encouraged to use one of the other password passing techniques, which are all more secure. In particular, people writing programs that are meant to communicate the password programatically are encouraged to use an anonymous pipe and pass the pipe's reading end to sshpass using the -d option. RETURN VALUES
As with any other program, sshpass returns 0 on success. In case of failure, the following return codes are used: 1 Invalid command line argument 2 Conflicting arguments given 3 General runtime error 4 Unrecognized response from ssh (parse error) 5 Invalid/incorrect password 6 Host public key is unknown. sshpass exits without confirming the new key. In addition, ssh might be complaining about a man in the middle attack. This complaint does not go to the tty. In other words, even with sshpass, the error message from ssh is printed to standard error. In such a case ssh's return code is reported back. This is typically an unimaginative (and non-informative) "255" for all error cases. EXAMPLES
Run rsync over SSH using password authentication, passing the password on the command line: rsync --rsh='sshpass -p 12345 ssh -l test' host.example.com:path . To do the same from a bourne shell script in a marginally less exposed way: SSHPASS=12345 rsync --rsh='sshpass -e ssh -l test' host.example.com:path . BUGS
Sshpass is in its infancy at the moment. As such, bugs are highly possible. In particular, if the password is read from stdin (no password option at all), it is possible that some of the input aimed to be passed to ssh will be read by sshpass and lost. Sshpass utilizes the pty(7) interface to control the TTY for ssh. This interface, at least on Linux, has a misfeature where if no slave file descriptors are open, the master pty returns EIO. This is the normal behavior, except a slave pty may be born at any point by a pro- gram opening /dev/tty. This makes it impossible to reliably wait for events without consuming 100% of the CPU. Over the various versions different approaches were attempted at solving this problem. Any given version of sshpass is released with the belief that it is working, but experience has shown that these things do, occasionally, break. This happened with OpenSSH version 5.6. As of this writing, it is believed that sshpass is, again, working properly. Lingnu Open Source Consulting August 6, 2011 SSHPASS(1)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy