Validate remote unix server credentials

SETHUNAVA

New Member
Joined
Jun 15, 2021
Messages
2
Reaction score
0
Credits
20
Looking for a command / method to validate credentials of a remote unix server

In windows if i run this command i can validate, if the user credentials are working or not by executing the below command

> systeminfo /S <remote-Windows-server> /U <username> /P <password>

if this command returns success value then i would assume the credentials are working otherwise i can confirm the credentials are not working.

Do we have a similar kind of command in unix to validate if the credentials provided for remote unix target server?
 


I'm not sure what you are trying to achieve by validating the credentials but you can just ssh into a remote system with the credentials and see if they work.
Code:
Then enter the password and if your credentials are correct it will let you in.
 
i want to validate the credentials via script & for (n) number of servers....
 
You could do one login attempt using ssh and then check on exit code if it was a succesful login on or not.
Bash:
sshpass -p "user1" ssh -o NumberOfPasswordPrompts=1 user1@server1 2>

if [[ $? -eq ]]
then
         echo "Login sucessfull!"
else
         echo "Login failed!"
fi
sshpass is a command you have to install from the system you are running it from, it has more options, as well as setting an environment variable to use as a password that makes it easier for scripting.
 

Staff online


Top