简体   繁体   中英

Plink timeout and proxy under linux

I have made a script in bash which create a connection to a list of server. After each connection, if it succeed, i execute a command. Connections are under a loop.

For know i use Plink. My script works, but it takes too much time when the server is unreachable. I encountered another issue when i wanted to reach a server through a proxy.

I have two goals :

  • Configure the timeout of Plink in command line under Linux to make it shorter ("FATAL ERROR: Connection timed out" takes to much time to appear).

  • Configure the proxy configuration of Plink to have the equivalent of the SOCKS5 and proxy hostname of PuTTY.

I don't know if it is possible. If you have a better way, i'll be glad to know it

regards, Mageni

Since your client is running Linux, I suggest using the openSSH ssh client that almost certainly comes with it, rather than plink.

1) OpenSSH's ssh client supports setting connection timeouts from commandline, eg to have it time out after 5 seconds you would use:

    ssh -o ConnectTimeout=5 <server>

2) Not entirely what you mean by this goal. Are you trying to connect to an SSH server through a socks5 proxy, or trying to configure a socks5 proxy locally by using an ssh client to proxy traffic to a remote system running an SSH server? If you elaborate, I can amend this response to include how to do either one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM