انجمن‌های فارسی اوبونتو

کمک و پشتیبانی => شبکه و سرویس‌ دهنده‌ها => نویسنده: kloxo در 23 امرداد 1390، 06:58 ق‌ظ

عنوان: باز كردن پورت دلخواه براي تونل
ارسال شده توسط: kloxo در 23 امرداد 1390، 06:58 ق‌ظ
سلام
همونوطور كه مي دونيد مثلا با پورت ssh  22
ميشه به لينوكس تونل زد و از اينترنت لينوكس استفاده كرد
حالا من يه سوال داشتم چطور مي تونم مثلا پورت 137 رو باز كنم و از طريق اين پورت تونل بزنم به لينوكس
مرسي
عنوان: پاسخ به: باز كردن پورت دلخواه براي تونل
ارسال شده توسط: هادی تایانلو در 01 شهریور 1390، 09:47 ق‌ظ
فایل زیر رو باز کنید
/etc/ssh/sshd_config

در سطری که پورت رو تعیین کرده تغییر بدید
عنوان: پاسخ به: باز كردن پورت دلخواه براي تونل
ارسال شده توسط: royaflash در 23 شهریور 1390، 08:47 ق‌ظ
سلام
همونوطور كه مي دونيد مثلا با پورت ssh  22
ميشه به لينوكس تونل زد و از اينترنت لينوكس استفاده كرد
حالا من يه سوال داشتم چطور مي تونم مثلا پورت 137 رو باز كنم و از طريق اين پورت تونل بزنم به لينوكس
مرسي

سلام  دوست عزیز .

برای این کار :

sudo ssh -L 3125:localhost:1775 royaflash@servername

رو میزنیم . در اینجا با پورت 3125 میتونیم به پورت 1775 تونل بزنیم .
موفق و لینوکسی باشید .


     -L [bind_address:]port:host:hostport
             Specifies that the given port on the local (client) host is to be forwarded to the given host and port on
             the remote side.  This works by allocating a socket to listen to port on the local side, optionally bound to
             the specified bind_address.  Whenever a connection is made to this port, the connection is forwarded over
             the secure channel, and a connection is made to host port hostport from the remote machine.  Port forward‐
             ings can also be specified in the configuration file.  IPv6 addresses can be specified with an alternative
             syntax: [bind_address/]port/host/hostport or by enclosing the address in square brackets.  Only the supe‐
             ruser can forward privileged ports.  By default, the local port is bound in accordance with the GatewayPorts
             setting.  However, an explicit bind_address may be used to bind the connection to a specific address.  The
             bind_address of “localhost” indicates that the listening port be bound for local use only, while an empty
             address or ‘*’ indicates that the port should be available from all interfaces.
عنوان: پاسخ به: باز كردن پورت دلخواه براي تونل
ارسال شده توسط: هادی تایانلو در 25 شهریور 1390، 12:58 ب‌ظ
سلام
همونوطور كه مي دونيد مثلا با پورت ssh  22
ميشه به لينوكس تونل زد و از اينترنت لينوكس استفاده كرد
حالا من يه سوال داشتم چطور مي تونم مثلا پورت 137 رو باز كنم و از طريق اين پورت تونل بزنم به لينوكس
مرسي

سلام  دوست عزیز .

برای این کار :

sudo ssh -L 3125:localhost:1775 royaflash@servername

رو میزنیم . در اینجا با پورت 3125 میتونیم به پورت 1775 تونل بزنیم .
موفق و لینوکسی باشید .


     -L [bind_address:]port:host:hostport
             Specifies that the given port on the local (client) host is to be forwarded to the given host and port on
             the remote side.  This works by allocating a socket to listen to port on the local side, optionally bound to
             the specified bind_address.  Whenever a connection is made to this port, the connection is forwarded over
             the secure channel, and a connection is made to host port hostport from the remote machine.  Port forward‐
             ings can also be specified in the configuration file.  IPv6 addresses can be specified with an alternative
             syntax: [bind_address/]port/host/hostport or by enclosing the address in square brackets.  Only the supe‐
             ruser can forward privileged ports.  By default, the local port is bound in accordance with the GatewayPorts
             setting.  However, an explicit bind_address may be used to bind the connection to a specific address.  The
             bind_address of “localhost” indicates that the listening port be bound for local use only, while an empty
             address or ‘*’ indicates that the port should be available from all interfaces.


دوست عزیز میشه توضیح بدید چطور این کارو میکنید شما بر اساس سوال دوستمون؟

ایشون شرایطشون فرق داره فقط و فقط به پورت ۱۳۷ دسترسی دارن یعنی کل اینترنت ایشون drop شده و فقط یک پورت باز دارن

حالا سرویس ssh که روی 22 کار میکنه چطوری شما این عملیات رو انجام میدید؟
عنوان: پاسخ به: باز كردن پورت دلخواه براي تونل
ارسال شده توسط: alieblice در 26 شهریور 1390، 10:14 ب‌ظ
سلام
همونوطور كه مي دونيد مثلا با پورت ssh  22
ميشه به لينوكس تونل زد و از اينترنت لينوكس استفاده كرد
حالا من يه سوال داشتم چطور مي تونم مثلا پورت 137 رو باز كنم و از طريق اين پورت تونل بزنم به لينوكس
مرسي

از سوالشون 2 تا برداشت میشه کرد
یا میخاستن فقط پرت ssh رو تغییر بدن که میشه پاسخ جناب هادی تایانلو  یا به خاطر این که گفتن تونل منظورشون همون forward کردن پرت بوده که میشه جواب جناب royaflash
پس سوال کژتابی داره


sudo ssh -L 3125:localhost:1775 royaflash@servername
توضیح دستور برایه نفر بعدی

دستور بالا میگه که هرچی اطلاعات به پرت 3125 فرستاده شد (( در سیستم لوکال  )) بگیرش و بفرستش از تو تونل به پرت 1775 که معمولا یک پرکسی سرور هستش .
پس برایه این که اطلاعاتتون از تو تونل بگذره باید در مرورگر  تنظیمات پروکسی رو برایه پرت 3125 تنظیم کنین