diff --git a/README.md b/README.md index 324fb90..3ca1c26 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ make clean; make # test - root@NIUYULING:/mnt/c/Users/niuyuling/Desktop/libssh2-tunnel# ./forward-tunnel -h + aixiao@NIUYULING:/mnt/c/Users/niuyuling/Desktop/libssh2-tunnel$ ./forward-tunnel -h STunnel SSH forward tunnel Author: AIXIAO@AIXIAO.ME Version: 1.0 @@ -25,6 +25,7 @@ -? -h : help information - Mar 24 2023 17:46:41 Compile、link. + Jan 3 2024 09:18:55 Compile、link. - root@NIUYULING:/mnt/c/Users/niuyuling/Desktop/libssh2-tunnel# \ No newline at end of file + aixiao@NIUYULING:/mnt/c/Users/niuyuling/Desktop/libssh2-tunnel$ + \ No newline at end of file diff --git a/forward-tunnel b/forward-tunnel deleted file mode 100644 index 98a1e00..0000000 Binary files a/forward-tunnel and /dev/null differ diff --git a/forward-tunnel.c b/forward-tunnel.c index 7dccb40..f29e171 100644 --- a/forward-tunnel.c +++ b/forward-tunnel.c @@ -3,9 +3,9 @@ const char *keyfile1 = "/home/aixiao/.ssh/id_rsa.pub"; const char *keyfile2 = "/home/aixiao/.ssh/id_rsa"; -char *server_ssh_ip = "47.108.253.59"; +char *server_ssh_ip = "127.0.0.1"; int server_ssh_port = 22; -char *server_ssh_user = "root"; +char *server_ssh_user = "aixiao"; char *server_ssh_passwd = "123456"; const char *local_listenip = "0.0.0.0"; @@ -437,5 +437,6 @@ shutdown: free(server_ssh_user); if (server_ssh_passwd) free(server_ssh_passwd); + return 0; } diff --git a/forward-tunnel.h b/forward-tunnel.h index bc58cee..5c87cc0 100644 --- a/forward-tunnel.h +++ b/forward-tunnel.h @@ -15,14 +15,11 @@ #include #include #include - #include #include - #include #define MAX_EVENTS 1024 - #define BUILD(fmt...) do { fprintf(stderr,"%s %s ",__DATE__,__TIME__); fprintf(stderr, ##fmt); } while(0) #ifndef INADDR_NONE diff --git a/forward-tunnel.o b/forward-tunnel.o deleted file mode 100644 index bd6dd76..0000000 Binary files a/forward-tunnel.o and /dev/null differ diff --git a/reverse-tunnel b/reverse-tunnel deleted file mode 100644 index e829bad..0000000 Binary files a/reverse-tunnel and /dev/null differ diff --git a/reverse-tunnel.c b/reverse-tunnel.c index c9f9867..0f7cb16 100644 --- a/reverse-tunnel.c +++ b/reverse-tunnel.c @@ -26,12 +26,12 @@ #define INADDR_NONE (in_addr_t)-1 #endif -const char *keyfile1 = "/home/username/.ssh/id_rsa.pub"; -const char *keyfile2 = "/home/username/.ssh/id_rsa"; -const char *username = "root"; +const char *keyfile1 = "/home/aixiao/.ssh/id_rsa.pub"; +const char *keyfile2 = "/home/aixiao/.ssh/id_rsa"; +const char *username = "aixiao"; const char *password = "12345"; -const char *server_ip = "47.240.75.93"; +const char *server_ip = "127.0.0.1"; const char *remote_listenhost = "0.0.0.0"; /* resolved by the remote server */ int remote_wantport = 33; @@ -46,7 +46,7 @@ enum { AUTH_PUBLICKEY }; -int forward_tunnel(LIBSSH2_SESSION * session, LIBSSH2_CHANNEL * channel) +int forward_tunnel(LIBSSH2_SESSION *session, LIBSSH2_CHANNEL *channel) { int i, rc = 0; struct sockaddr_in sin; diff --git a/reverse-tunnel.o b/reverse-tunnel.o deleted file mode 100644 index a4ea6ab..0000000 Binary files a/reverse-tunnel.o and /dev/null differ