我能限制我的autoSSH隧道速度涓stream和SSHconfiguration文件选项?

当我只使用〜$ autossh site1的时候,它可以很好的工作,但是whitmen trickle pameter site1被认为是DNS Name而不是conf block。

User@VM:~$ sudo trickle -d 10 -u 10 -- autossh site1 [sudo] password for User: ssh: Could not resolve hostname site1: Temporary failure in name resolution 

不过, site1不是一个DNS名称,是我的configuration文件中的条目,如:

 Host site1 HostName 89.32.12.206 Port 222 User sctfic Compression yes CompressionLevel 7 IdentityFile ~/.ssh/id_rsa LocalForward *:9100 10.1.253.100:9100 LocalForward *:9101 imp:9100 

当您使用sudo时,您将切换到root帐户,而不是您自己的帐户。 这意味着ssh将读取root的.ssh/config而不是你的。

如果您必须以root身份运行涓stream,那么首先将您自己的sshconfiguration和密钥复制到root的.ssh目录。

ssh手册页说主机名在命令中是必须的,但是也要定义一个-F configfile

ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:] port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [ -L [bind_address:] port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o选项] [-p端口] [-Q cipher | cipher-auth | mac | kex | 密钥] [-R [bind_address:] port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun [:remote_tun]] [user @] hostname [command]

我build议你尝试一下:

 sudo trickle -d 10 -u 10 -- autossh -F /path/to/config-file site1