Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use of the sshpass command

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

I believe that most people do not know how to use the sshpass command shared in this article. In order to let you learn, I have summarized the following contents. Without saying much, let's read on.

The sshpass command uses the

1. Directly connect the host remotely.

Sshpass-p 'password' ssh root@192.168.100.11

2. Specify the port of ssh for remote connection.

Sshpass-p 'password' ssh-p 2222 ssh root@192.168.100.11

3. Read the password file as the password to remotely connect to the host.

Sshpass-f passwd.txt ssh root@192.168.100.11

4. Pull the file to the local on the remote host

Sshpass-p 'password' scp root@192.168.100.11:/ remote directory / / local directory /

5. Copy the local directory file to the remote directory

Sshpass-p 'password' scp / local directory / root@192.168.100.11:/ remote directory /

6. Copy the local directory files to the designated port of the remote directory

Sshpass-p 'password' scp-P 2222 / local directory / root@192.168.100.11:/ remote directory /

7. Connect the host remotely and execute the command

Sshpass-p 'password' ssh-o StrictHostKeyChecking=no root@192.168.100.11'rm-rf / tmp/test'

-o StrictHostKeyChecking=no: ignore password prompts

The above is the use of the sshpass command, the detailed use of their own use to know the specific essentials. If you want to read more related articles, you are welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report