How to pass password as a variable for sshpass authentication?


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
How to pass password as a variable for sshpass authentication?

Using below below command i'm able to connect or authenticate server, In below command password contains special characters
Code:
sshpass -v  -p 'ASJBA%hs76)#' ssh -q -o ConnectTimeout=5 hostname

But If I pass password as a variable I'm not able to connect or authenticate server, can you please help me to fix this
Code:
sshpass -v  -p $password ssh -q -o ConnectTimeout=5 hostname

Code:
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4

Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Password-less RSA Authentication not working
mehimadri
Hello Friends, I know this issue has been raised many times and hence I tried every resolution provided in the forum before I posted this issue again. My Password-less RSA authentication was working fine for quite some time. Whenever the remote server password used to change I used to re-do...... Shell Programming and Scripting
5
Shell Programming and Scripting
can't bypass password authentication
vijill
I can able to SFTP from my web server unix to apps server unix end. but the other way from APPS server to Web server is still asking me the password. I have done same procedure both side. still i am having same problem. Any one help on this. thanks, regards... Solaris
3
Solaris
Enhanced Password Authentication
rambo15
Hello; I am moving a customer from Solaris 2.6 to Solaris 2.8. The customer has requested the following two requirements also be implemented: 1. Lock a user account out for X number of days after 3 unsuccessful login attempts. 2. No reuse of the last 5-10 passwords. Also referred to...... Solaris
1
Solaris
disallowing user/pass authentication in favor of a pure key system?
xyyz
i finally got my key-pair system working... sort of a makeshift eToken system. however, i only want to allow this sytem for system access. i don't want to allow for the standard user/pass authentication system. right now i changed the following: # To disable tunneled clear text passwords,...... UNIX for Advanced & Expert Users
2
UNIX for Advanced & Expert Users
Password Authentication
juan_o_morillo
I would like to know how to validate an unix password from shell script (If is possible) Thanks very much ;)... Cybersecurity
3
Cybersecurity

Featured Tech Videos