Tecnologia da Informação - TI : Use SSHPass

Total de visualizações de página

segunda-feira, 11 de abril de 2016

Use SSHPass


Use SSHPass
2015/04/15
 
Use SSHPass to automate inputting password on password authentication.
This is convenient but has security risks (leak of password), take special care if you use it.
[1]Install SSHPass.
# install from EPEL

[root@dlp ~]# 
yum --enablerepo=epel -y install sshpass
[2]How to use SSHPass.
# -p password : from argument

[cent@dlp ~]$ 
sshpass -p password ssh 10.0.0.51 hostname 

node01.server.world
# -f file : from file

[cent@dlp ~]$ 
echo 'password' > sshpass.txt 

[cent@dlp ~]$ 
chmod 600 sshpass.txt 

[cent@dlp ~]$ 
sshpass -f sshpass.txt ssh 10.0.0.51 hostname 

node01.server.world
# -e : from env variable

[cent@dlp ~]$ 
export SSHPASS=password 

[cent@dlp ~]$ 
sshpass -e ssh 10.0.0.51 hostname 

node01.server.world

Nenhum comentário:

Postar um comentário

Jesus Cristo: A Esperança Que Nunca Acaba

  Jesus Cristo continua sendo a maior referência de amor e fé para milhões de pessoas no mundo inteiro. Em tempos difíceis, quando muitos p...