Privileged ports can only be forwarded by root windows 10

1903 update ssh tunnel problem

When I try to create ssh tunnel to port 443 I get error saying: «Privileged ports can only be forwarded by root.»

To connect I use this command:

Now, until I installed update number 1903, I could connect using powershell without problems. Ever since that update I am getting no privileged ports error. I have admin account on my windows machine.

What can I do for a workaround, or should I revert update?

Replies (5) 

My name is Andre Da Costa; an Independent Consultant, Windows Insider MVP and Windows & Devices for IT MVP. I’m here to help you with your problem.

Have you installed the OpenSSH Client to see if that works?

Click Start > Settings > Apps > Optional features
Scroll down
Click OpenSSH Client
Click install

1 person found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

yes, I have OpenSSH Client installed already.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Others are reporting this issue too, its probably best you file a bug report then roll back until it is fixed:

send me the short link so I can vote on it and bring it to the attention of the Windows engineers.

Open Start > Settings > Update & security > Recovery > under Go back to my previous version of Windows 10, click Get started.
or
Press Control + Alt + Delete
Click Sign out

At the Sign In screen, hold down the shift key on your keyboard while clicking the Power button on the screen
Continue to hold down the shift key while clicking Restart
Continue to hold down the shift key until the Advanced Recovery Options menu appears

Click Advanced options

Click Go back to the previous version of Windows

Windows Update might attempt to upgrade to Windows 10 1809 again. See instructions how to block it:
https://www.groovypost.com/howto/block-windows-.

Information in the above link is sourced from a trusted Microsoft MVP blog.

Источник

ИТ База знаний

Полезно

— Онлайн генератор устойчивых паролей

— Онлайн калькулятор подсетей

— Руководство администратора FreePBX на русском языке

— Руководство администратора Cisco UCM/CME на русском языке

— Руководство администратора по Linux/Unix

Навигация

Серверные решения

Телефония

FreePBX и Asterisk

Настройка программных телефонов

Корпоративные сети

Протоколы и стандарты

Популярное и похожее

Курс по сетям

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

15 примеров команды PING для диагностики сети

Руководство по команде grep в Linux

Рекурсивно найти слово в файлах и папках Linux

Команда Ln: как создавать символические ссылки в Linux

Лучшие HEX – редакторы для Linux

Мониторинг сервера с помощью Linux-dash

Как установить или изменить User-Agent с помощью curl

Еженедельный дайджест

Про SSH port forwarding в Linux

SSH туннели один из самых часто используемых методов связи среди системных и сетевых администраторов. В данном руководстве расскажем о такой функции как переброс порта SSH. Это используется для безопасной передачи данных между двумя и более системами.

Обучайся в Merion Academy

Пройди курс по сетевым технологиям

Что такое переброс порта SSH?

Коротко, переброс порта SSH даёт возможность создавать туннель между несколькими системами, а затем настроить эти системы так, чтобы трафик они гнали через этот туннель. Именно по такой логике работает VPN или SOCKS Proxy.

Есть несколько разных методов переброса: переброс локального порта, переброс удалённого порта или динамический переброс. Для начала дадим пояснение каждому из них.

Для чего нужен переброс порта SSH?

Допустим у вас есть какое-то приложение, которые передаёт данные в открытом виде или через нешифрованный протокол. Ввиду того, что SSH создает шифрованное соединение, то вы с легкостью можете настроить программу так, чтобы трафик её шёл через этот туннель.

Он так же часто используется для доступа к внутренним ресурсам извне. Приблизительно это напоминает Site-to-Site VPN, где нужно указывать какой именно трафик нужно заворачивать в туннель.

Сколько сессий можно устанавливать?

Теоретически, можно создавать столько сессий, сколько нам захочется. В сети используется 65 535 различных портов, и мы можем перебрасывать любой из этих портов.

Но при перебросе порта нужно учитывать, что некоторые из них зарезервированы за конкретными сервисами. Например, HTTP использует 80 порт. Значит, переброс на порт 80 возможен только если нужно переадресовать веб трафик.

Порт, который перебрасывается на локальном хосте может не совпадать с портом удаленной системы. Мы легко можем перебросить локальный порт 8080 на порт 80 на удаленной машине. Иными словами, если мы напишем IP адрес нашей машины и порт 8080, то запрос пойдет на 80 порт удалённой системы.

Если вам не критично какой порт использовать на своем хосте, лучше выбрать что-то из диапазона 2000-10000, так как все порты ниже 2000 зарезервированы.

Переброс локального порта

Локальная пересылка представляет собой переброс порта из клиентской системы на сервер. Он позволяет настроить порт в системе таким образом, чтобы все соединения на этот порт проходили через туннель SSH.

Для переадресации локального порта используется ключ L. Общий синтаксис команды таков:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Данной командой мы говорим системе, что все запросы на 8080 порт example1.com переадресовывать на example2.com. Это часто используется когда нужно организовать доступ извне на внутренний ресурсы компании.

Тестирование работы переадресованного порта

Чтобы проверить, работает ли переадресация должным образом можно воспользоваться утилитой netcat. На машине, где была запущена команда переадресации нужно ввести команду netcat в следующем виде:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Если переадресация работает и трафик проходит, то утилита вернёт «Успех!». В противном случае выдаст ошибку об истечении времени ожидания.

Если что-то не работает, нужно убедиться, что подключение к удаленному порту по SSH работает корректно и запросы не блокируются межсетевым экраном.

Создание постоянного туннеля (Autossh)

Для создания туннеля, который будет активен постоянно используется так называемая утилита Autossh. Единственно требование это необходимость настройки между двумя системами аутентификацию по публичным ключам, чтобы не получать запросы на ввод пароля при каждом обрыве и восстановлении соединения.

По умолчанию, Autossh не установлен. Чтобы установить эту утилиту введем команду ниже.

Синтаксис утилиты autossh почти похож на синтаксис ssh:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Переброс удалённого порта

Переброс порта с удалённой машины используется в тех случаях, если нужно предоставить доступ на свой хост. Допусти у нас установлен веб сервер и нам нужно, чтобы друзья могли пользоваться им. Для этого нужно ввести команду показанную ниже:

А общий синтаксис команды выглядит так:

Динамическая переадресация портов

Динамическая переадресация портов позволит ssh функционировать как прокси-сервер. Вместо переброса трафика на специфический порт, здесь трафик будет идти через на диапазон портов.

Если вы когда-нибудь пользовались прокси сервером для посещения заблокированного сайта или просмотра контента, недоступного в вашем регионе, вероятнее всего вы пользовались SOCKS сервером.

Динамическая переадресация также обеспечивает некоторую приватность. Она затрудняет логирование и анализ трафика, так как трафик проходит через промежуточный сервер. Для настройки динамической переадресации используется следующая команда:

Таким образом, если нужно весь трафик идущий на порт 1234 направить на SSH сервер, нужно ввести команду:

После установления соединения, мы можем указать в приложениях, например, браузере, пропускать трафик через туннель.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Множественная переадресация

Иногда приходится перебрасывать несколько внутренних портов на несколько внешних. Допустим у нас на одном и том же сервере крутятся и веб сервер и oracale. В таком случае мы можем указать несколько условий переадресации ставя перед каждым из них ключ L для локальной переадресации и R для внешней.

Просмотр списка туннелей

Чтобы просмотреть сколько SSH туннелей активны на данный момент можно прибегнуть к помощи команды lsof:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Как видим, на нашей системе сейчас активно три подключения. Чтобы вместо имени хоста показать IP адрес к команде нужно добавить ключ n.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Ограничение переадресации портов

По умолчанию, переброс портов SSH активен для всех. Но если нужно ограничить переадресацию портов в целях безопасности, то нужно отредактировать файл sshd_config.

$ sudo vi /etc/ssh/sshd_config

Здесь есть несколько опций, позволяющих ограничивать создание SSH туннелей.

PermitOpen позволяет прописать адреса, для которых можно включить переадресацию портов. Тут можно указать конкретный IP адреса или название хоста:

AllowTCPForwarding данная опция включает или отключает переадресацию портов для SSH. Так же можно указать какой тип переадресации допускается на этом хосте.

Для подробной информации можно вызвать руководство по файлу sshd_config:

Уменьшение задержки

Проблема с переадресацией портов на SSH это возможность увеличения задержки. При работе с текстовой информацией э то не критично. Проблема даёт о себе знать если по сети идёт много трафика, а SSH сервер настрое как SOCKS сервер, то есть на нём настроена динамический переброс портов.

Это происходит по той причине, что SSH туннели по сути это TCP туннель поверх TCP. Это не очень эффективный метод передачи данных.

Для решения проблемы можно настроить VPN, но если по какой-то причине предпочитаете SSH туннели, то существует программа sshuttle, которая устраняет проблему. На Ubuntu или других дистрибутивах семейства Debian программу можно установить командой

Если же программы нет в репозиториях дистрибутива, то можно взять ее с GitHub:

Настройка туннеля в sshuttle отличается от SSH. Чтобы завернуть весь трафик в туннель нужно ввести следующую команду:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Прервать соединение можно комбинацией клавиш Ctrl+C. Чтобы запустить sshuttle как демон, нужно добавить ключ D.

Чтобы убедиться что туннель поднят и в глобальной сети показывается другой IP, в терминале можно ввести команду:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Или же просто открыть любой другой сайт, который покажет белый IP и местоположение.

Источник

Windows and privileged ports I have the same question (33)

Replies (8) 

Have you seen this?

Configure for both Private and/or Public depending on where the computer is located, ie. on your home LAN or connected directly to the public internet.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your response, Al Jarvi. Like I said, I disabled the firewall. So unfortunately the links you gave do not help.

The firewall is absolutely, positively NOT preventing the connection. I suspect that there is a mechanism built into Windows that prevents binding to ports ·

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Dustin. I’m actually running a honeypot, which is a python program emulating an ssh server. It’s not actually an ssh server. That’s what’s leading me to believe there is some mechanism that doesn’t allow processes (not owned by administrator maybe?) to connect on low ports.

The honeypot will listen and connect on port 2222, so I know I have it configured correctly. When I change it to port 22, the connection is refused with the exact same configuration.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Dustin. I’m actually running a honeypot, which is a python program emulating an ssh server. It’s not actually an ssh server. That’s what’s leading me to believe there is some mechanism that doesn’t allow processes (not owned by administrator maybe?) to connect on low ports.

The honeypot will listen and connect on port 2222, so I know I have it configured correctly. When I change it to port 22, the connection is refused with the exact same configuration.

This page indicates this particular python honeypot can only use TCP Port 2222.

You might chech the documentation or support site for your particular software.

With sufficient security running a real SSH server is not an issue IMHO. I used to run a copSSH server.

Источник

unixforum.org

Форум для пользователей UNIX-подобных систем

Помогите настроить ssh-соединение.

Модератор: SLEDopit

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Помогите настроить ssh-соединение.

Сообщение savigm » 07.05.2009 00:50

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение sash-kan » 07.05.2009 04:54

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение drBatty » 07.05.2009 05:13

Скоро придёт
Осень

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение drBatty » 07.05.2009 21:05

Скоро придёт
Осень

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение savigm » 13.05.2009 01:30

На этом попытки коннекта кончились, порт 4040 открыт, ключи Я генерил на компе за NAT’ом, public key скопировал на комп сервера в authorized_keys.

Подскажите, в чем загоздка, почему комп за NAT’ом болше не стучится на сервер?

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение sash-kan » 13.05.2009 04:59

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение savigm » 13.05.2009 15:41

Непонятно почему ключ три раза принялся, и на этом все закончилось. Возможно на компе за NAT’ом процесс после соединения продолжает висеть, хотя соединения давно уже нет.
Может для надежности в кронтабе убрать проверку работы процесса, и стучаться каждые пять минут на сервер:

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение savigm » 14.05.2009 13:28

Вот лог удачного коннекта.

Подскажите дальнейшие действия по прокладыванию ssh-туннеля.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение savigm » 15.05.2009 12:27

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Re: Помогите настроить ssh-соединение.

Сообщение sash-kan » 16.05.2009 00:50

так. давайте снова на пальцах. а то я полностью потерял нить ваших рассуждений.

Источник

Is there a way for non-root processes to bind to “privileged” ports on Linux?

It’s very annoying to have this limitation on my development box, when there won’t ever be any users other than me.

I’m aware of the standard workarounds, but none of them do exactly what I want:

Is there some simple sysctl variable to allow non-root processes to bind to «privileged» ports (ports less than 1024) on Linux, or am I just out of luck?

EDIT: In some cases, you can use capabilities to do this.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

24 Answers 24

Okay, thanks to the people who pointed out the capabilities system and CAP_NET_BIND_SERVICE capability. If you have a recent kernel, it is indeed possible to use this to start a service as non-root but bind low ports. The short answer is that you do:

Now for the caveats:

You can do a port redirect. This is what I do for a Silverlight policy server running on a Linux box

The standard way is to make them «setuid» so that they start up as root, and then they throw away that root privilege as soon as they’ve bound to the port but before they start accepting connections to it. You can see good examples of that in the source code for Apache and INN. I’m told that Lighttpd is another good example.

Another example is Postfix, which uses multiple daemons that communicate through pipes, and only one or two of them (which do very little except accept or emit bytes) run as root and the rest run at a lower privilege.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Or patch your kernel and remove the check.

(Option of last resort, not recommended).

and the kernel won’t check privileged ports anymore.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Update 2017:

Use authbind

Much better than CAP_NET_BIND_SERVICE or a custom kernel.

Authbind grants trust to the user/group and provides control over per-port access, and supports both IPv4 and IPv6 (IPv6 support has been added as of late).

Install: apt-get install authbind

Configure access to relevant ports, e.g. 80 and 443 for all users and groups:

sudo touch /etc/authbind/byport/80
sudo touch /etc/authbind/byport/443
sudo chmod 777 /etc/authbind/byport/80
sudo chmod 777 /etc/authbind/byport/443

As a follow-up to Joshua’s fabulous (=not recommended unless you know what you do) recommendation to hack the kernel:

I’ve first posted it here.

Simple. With a normal or old kernel, you don’t.
As pointed out by others, iptables can forward a port.
As also pointed out by others, CAP_NET_BIND_SERVICE can also do the job.
Of course CAP_NET_BIND_SERVICE will fail if you launch your program from a script, unless you set the cap on the shell interpreter, which is pointless, you could just as well run your service as root.
e.g. for Java, you have to apply it to the JAVA JVM

Obviously, that then means any Java program can bind system ports.
Dito for mono/.NET.

You just download the source for the latest kernel (or the same you currently have). Afterwards, you go to:

There you look for this line

if you don’t want to have an insecure ssh situation, you alter it to this: #define PROT_SOCK 24

Generally, I’d use the lowest setting that you need, e.g 79 for http, or 24 when using SMTP on port 25.

Here’s how you compile a kernel:

In a nutshell, use iptables if you want to stay secure, compile the kernel if you want to be sure this restriction never bothers you again.

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

Privileged ports can only be forwarded by root windows 10. Смотреть фото Privileged ports can only be forwarded by root windows 10. Смотреть картинку Privileged ports can only be forwarded by root windows 10. Картинка про Privileged ports can only be forwarded by root windows 10. Фото Privileged ports can only be forwarded by root windows 10

You can setup a local SSH tunnel, eg if you want port 80 to hit your app bound to 3000:

This has the advantage of working with script servers, and being very simple.

For some reason no one mention about lowering sysctl net.ipv4.ip_unprivileged_port_start to the value you need. Example: We need to bind our app to 443 port.

Some may say, there is a potential security problem: unprivileged users now may bind to the other privileged ports (444-1024). But you can solve this problem easily with iptables, by blocking other ports:

Comparison with other methods. This method:

Depending on the situation, I would choose between sysctl, CAP, authbind and iptables-redirect. And this is great that we have so many options.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *