部署sshpass
1.下载
wget -O sshpass.tar.gz
2.编译安装
tar -zxvf sshpass.tar.gz
cd sshpass-1.06
./configure
make
make install
3.使用
/opt/sshpass-1.06/sshpass -p oracle scp /home/oracle/soft/sshpass.tar.gz oracle@192.168.1.1:/home/oracle/script/
/opt/sshpass-1.06/sshpass -p oracle ssh oracle@192.168.1.1 -o StrictHostKeyChecking=no "/home/oracle/script/get_df.sh" 2>/dev/null
问题:
报如下错误,需要安装gcc
[root@localhost sshpass-1.06]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/sshpass-1.06':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
解决办法:
[root@localhost sshpass-1.06]# yum install gcc
问题2:
[root@lenovo ~]# ssh root@192.168.1.21
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:qdaqNv1/Aoy17uW+KnGdNwRKGl1UNLejMSe5r7R08lc.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:11
RSA host key for 192.168.1.21 has changed and you have requested strict checking.
Host key verification failed.
编辑如下文件,删除相应的条目
[root@lenovo ~]# vi ~/.ssh/known_hosts
阅读(5593) | 评论(0) | 转发(0) |