如何检查scp是否可用?

时间:2020-12-04 16:55:02

For my system I have to know whether I can do SCP (with or without transfering a file) with a particular number of systems in the network repeatedly.

对于我的系统,我必须知道我是否可以反复使用网络中特定数量的系统来执行SCP(有或没有传输文件)。

We may not transfer files but we have to know how we can do SCP without giving a password.

我们可能不会传输文件,但我们必须知道如何在不提供密码的情况下执行SCP。

2 个解决方案

#1


You may find Net::SCP Perl module helpful.

您可能会发现Net :: SCP Perl模块很有用。

#2


You could try to see if the remote host responds on port 22. There are various tools that try to open a port. For example, try

您可以尝试查看远程主机是否在端口22上响应。有各种工具尝试打开端口。例如,试试

curl :22

this will print something different depending on whether the port responds or not. I'm sure there are better tools (nmap, for example) that could do the job, but that's the first that came to mind.

这将打印不同的东西,具体取决于端口是否响应。我确信有更好的工具(例如nmap)可以完成这项工作,但这是第一个想到的工具。

This won't of course test whether SCP will actually work. could be that ssh but not scp is enabled. But it will get you closer.

这当然不会测试SCP是否真的有效。可能是ssh但不启用scp。但它会让你更接近。

#1


You may find Net::SCP Perl module helpful.

您可能会发现Net :: SCP Perl模块很有用。

#2


You could try to see if the remote host responds on port 22. There are various tools that try to open a port. For example, try

您可以尝试查看远程主机是否在端口22上响应。有各种工具尝试打开端口。例如,试试

curl :22

this will print something different depending on whether the port responds or not. I'm sure there are better tools (nmap, for example) that could do the job, but that's the first that came to mind.

这将打印不同的东西,具体取决于端口是否响应。我确信有更好的工具(例如nmap)可以完成这项工作,但这是第一个想到的工具。

This won't of course test whether SCP will actually work. could be that ssh but not scp is enabled. But it will get you closer.

这当然不会测试SCP是否真的有效。可能是ssh但不启用scp。但它会让你更接近。