我正在使用带有RSE的eclipse,当我在同一个网络时,它可以很好地连接到我的linux服务器,但由于服务器位于带有门入口的防火墙后面,我需要在其网络外部进行ssh隧道.
我还没有找到一种方法可以将我拥有隧道的本地端口添加到主机名,也无法在其他地方添加.

是否可以使用RSE连接到localhost:port?
在我的开发工作室中,我们在位于远程网络上的虚拟服务器上部署代码.
我们通过首先打开到网关服务器的SSH连接,然后通过本地端口SSH隧道传输RDP来访问该网络上的计算机.
我非常希望能够以相同的方式本地访问在这些服务器上运行的SQL Server实例.
我已经设置了一个本地端口(3398)来重定向到远程实例上的SQL Server端口(L3398 - > remote.machine.com:1433).
然后我可以通过telnet到localhost 3398实际测试连接,然后我得到一个连接:屏幕清除,我可以在一些监听过程中输入字符.
但是当我尝试将SSMS连接到localhost:3398时,它超时然后声称没有SQL Server侦听该端口:
Cannot connect to localhost:3398
Additional information:
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the
instance name is correct and that SQL Server is configured to allow remote
connections. (...)
Run Code Online (Sandbox Code Playgroud)
我确信服务器接受远程连接,因为我已通过RDP远程连接到远程连接到远程网络中的其他计算机.
我用谷歌搜索知道这是可能的; 有没有人知道为什么这不起作用,或者我可能做什么来诊断并希望解决问题?
谢谢!
我有一个特定的场景,我想解决.我目前通过端口转发连接到主机:
laptop -> gateway -> remote_server_1
Run Code Online (Sandbox Code Playgroud)
和另一位主持人:
laptop -> remote_server_2
Run Code Online (Sandbox Code Playgroud)
使用无密码登录.这两个远程服务器都不对外界可见.现在我正在remote_server_2上运行一项服务,我希望能够访问remote_server_1.我认为我必须设置从remote_server_1到我的笔记本电脑的反向端口转发,然后再到remote_server_2,但我不知道如何做到这一点.以前有人遇到过这种情况吗?
编辑:完整的解决方案,以防其他人需要它:
mylaptop$ ssh -L 3001:localhost:3000 server_2
server_2$ netcat -l 3000
Run Code Online (Sandbox Code Playgroud)
然后通过以下gateway方式设置隧道server_1:
ssh -t -t -L 3003:server_1:22 gateway
Run Code Online (Sandbox Code Playgroud)
然后从server_1以下位置访问:
ssh -R 3002:localhost:3001 -p3003 localhost
echo "bar" | nc localhost 3002`
Run Code Online (Sandbox Code Playgroud)
嘿presto server_2显示bar:-)
我有一个perl脚本,当有点蒸馏时,看起来像这样:
my $randport = int(10000 + rand(1000)); # Random port as other scripts like this run at the same time
my $localip = '192.168.100.' . ($port - 4000); # Don't ask... backwards compatibility
system("ssh -NL $randport:$localip:23 root\@$ip -o ConnectTimeout=60 -i somekey &"); # create the tunnel in the background
sleep 10; # Give the tunnel some time to come up
# Create the telnet object
my $telnet = new Net::Telnet(
Timeout => 10,
Host => 'localhost',
Port => $randport,
Telnetmode …Run Code Online (Sandbox Code Playgroud) 现在我正在创建一个 ssh 隧道,这样我就可以连接到我的远程数据库,但由于某种原因连接仍然拒绝......我的脚本:
try {
$host = 'remote host';
$sshuser = 'ssh user';
$sshpass = 'ssh password';
$dbuser = 'db user';
$dbpass = 'db user';
$dbname = 'db name';
shell_exec("ssh -p$sshpass ssh -o StrictHostKeyChecking=no -f -L 3307:127.0.0.1:3306 $sshuser@$host");
$dbh = new PDO('mysql:host=127.0.0.1;port=3307;dbname=' .$dbname. '', $dbuser, $dbpass);
$sth = $dbh->prepare("SELECT * from table");
$sth->execute();
$result = $sth->fetchAll();
print_r ($result);
shell_exec("kill $(ssh-pid)");
$dbh = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
Run Code Online (Sandbox Code Playgroud)
结果我得到:
Error!: SQLSTATE[HY000] …Run Code Online (Sandbox Code Playgroud) 如果用户位于特定的Active Directory组中,是否可以仅允许通过SSH端口隧道使用端口?
我有一台客户端计算机,一台Windows Web服务器和一台带有数据库的Linux服务器.我希望客户端能够使用SSH连接到数据库,但前提是它们位于特定的AD组中.
有没有办法实现这个目标?
我尝试根据说明在 Java 程序中使用 SSH 与 PythonAnywhere 中的 MySQL 库建立连接: https:
//help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere
不幸的是,我每次都会遇到这个错误,而且我已经没有想法了:
com.jcraft.jsch.JSchException:拒绝主机密钥:ssh.pythonanywhere.com
public static void main(String[] args) {
Tunnel tunnel = new Tunnel();
try {
tunnel.go();
} catch (Exception e) {
e.printStackTrace();
}
}
public void go() throws Exception {
String host = "ssh.pythonanywhere.com";
String user = "username";
String password = "password";
int port = 22;
int tunnelLocalPort = 9080;
String tunnelRemoteHost = "username.mysql.pythonanywhere-services.com";
int tunnelRemotePort = 3306;
JSch jsch= new JSch();
Session session = jsch.getSession(user,host,port);
localUserInfo lui = …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 WebRTC 将视频流式传输到浏览器。我收到的错误是WebRTC: ICE failed, add a STUN server and see about:webrtc for more details. 这对我来说有点令人惊讶,因为在我的代码中,我在对等连接的配置对象中提到了谷歌 STUN 服务器之一,如下所示:
const config = {
iceServers: [
{
urls: ['stun:stun.l.google.com:19302']
}
]
};
Run Code Online (Sandbox Code Playgroud)
我已经在 PC 上对此进行了测试,该项目正在运行并且能够在那里看到流。现在我想通过 ssh 隧道访问该网站。我转发了端口,现在可以在浏览器中打开 localhost:4000 并查看网站,但是视频不会显示,我会收到所描述的错误。
如何将视频也传输到远程 PC,或者为什么它无法通过 ssh 隧道工作?提前致谢!
I have a server which I can only access via SSH, I have installed MySQL on this server. And created a remote user so I could develop using mySQL workbench, but when try to SSH using MySQL workbench GUI I get the following error: Could not connect the SSH tunnel Authentication that can continue public key.
I'm able to connect to the user from the server itself and that works without any problems, I've checked the privileges and remote access …
有很多工具可以更改数据包中的 sni。ssh 是否使用 sni 或者 HTTP 注入器之类的软件如何更改 SNI 并浏览互联网。
ssh-tunnel ×10
ssh ×3
linux ×2
connection ×1
database ×1
eclipse ×1
eclipse-rse ×1
http-headers ×1
java ×1
jsch ×1
mysql ×1
openssh ×1
pdo ×1
perl ×1
php ×1
sni ×1
sql-server ×1
stun ×1
telnet ×1
tunneling ×1
webrtc ×1