![]() ![]() Connect ssh from C to A using B as bastion host.Īnd map local port to local port on A. ![]() In this scenario Mysql connection B -> C not encrypted by ssh.Ģ.1. it used for reverse connect.Īnd map local port (3306 or any nonstandard) to B:3306 ssh -L 3306:A:3306 then connect Mysql client to localhost:3306 R (remote) listen on remote host, on host you connect to by ssh. L (local) listen on local host, where you run ssh. Indeed communication between A and B via localhost is working. In server B I've installed mysql-client, and then testing connection to server A goes well: mysql -u -p -host 127.0.0.1 -P 3306 There's something wrong in port usages? UPDATE When I run the above php script, I've get the error: Error!: SQLSTATE Connection refused ![]() Map remote B:3306 to localhost:3337, using: ssh -R 3306:localhost:3337 localhost:3337 to A:3306, using: ssh -L 3337:localhost:3306 php script to open connection to B: $host= '' Server A has a mysql server (obviously), but server B hasn't a mysql server. In server C I run PHP scripts to open a mysql connectionto B (which is not a mysql-server).I've three servers A, B, and C, plus my localhost.Įach server is inside a proper network, and server C should connect to a mysql DB in server A on port 3306 to perform some tests. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |