windows:server:2008:r2:openssh:install
-
-
На момент написания это v8.1.0.0p1-Beta.
-
-
Распаковать в
C:Program Files
;-
Или куда угодно, но помните, что из него в дальнейшем будут запускаться службы.
-
-
Добавить путь
C:Program FilesOpenSSH-Win64
в переменную PATH.-
Свойства системы – Дополнительные параметры – Переменные среды… – Системные переменные – Path, далее в конце стоки через точку с запятой вставить путь без кавычек.
-
-
Запустить PowerShell с правами администратора, перейти в каталог
C:Program FilesOpenSSH-Win64
и ввести./install-sshd.ps1
(PowerShell пока не закрывать!); -
Запустить службу
OpenSSH SSH Server
(sshd) и настроить ее на автоматический запуск; -
Вернуться в PowerShell и выполнить
./FixHostFilePermissions.ps1
везде соглашаясь;
Если есть ошибки, проверить наличие папки C:ProgramDataSSH
и ключевых файлов в ней. Ключевые файлы создаются при первом запуске службы.
Дисклеймер
-
Использование материалов данной базы знаний разрешено на условиях лицензии, указанной внизу каждой страницы! При использовании материалов активная гиперссылка на соответствующую страницу данной базы знаний обязательна!
-
Автор не несет и не может нести какую либо ответственность за последствия использования материалов, размещенных в данной базе знаний. Все материалы предоставляются по принципу «как есть». Используйте их исключительно на свой страх и риск.
-
Все высказывания, мысли или идеи автора, размещенные в материалах данной базе знаний, являются исключительно его личным субъективным мнением и могут не совпадать с мнением читателей!
-
При размещении ссылок в данной базе знаний на интернет-страницы третьих лиц автор не несет ответственности за их техническую функциональность (особенно отсутствие вирусов) и содержание! При обнаружении таких ссылок, можно и желательно сообщить о них в комментариях к соответствующей статье.
Последнее изменение: 2022/02/12 11:40 (внешнее изменение)
- Remove From My Forums
-
Question
-
Hi,
Does any have a step by step on how to enable and configure SFTP server on Server 2008 R2?
jaie
Answers
-
Hello,
SFTP (SSH + FTP) is not supported on IIS. Only FTPS (FTP + SSL) is supported.
More here: http://forums.asp.net/t/1430627.aspx#B42
This
posting is provided «AS IS» with no warranties or guarantees , and confers no rights.Microsoft
Student Partner 2010 / 2011
Microsoft
Certified Professional
Microsoft
Certified Systems Administrator: Security
Microsoft
Certified Systems Engineer: Security
Microsoft
Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
Microsoft
Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
Microsoft
Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
Microsoft
Certified Technology Specialist: Windows 7, Configuring
Microsoft
Certified Technology Specialist: Designing and Providing Volume Licensing Solutions to Large Organizations
Microsoft
Certified IT Professional: Enterprise Administrator
Microsoft Certified IT Professional: Server Administrator
Microsoft Certified Trainer-
Proposed as answer by
Tuesday, April 17, 2012 3:41 AM
-
Marked as answer by
Miya Yao
Tuesday, April 24, 2012 8:42 AM
-
Proposed as answer by
Как установить SSH Server в Windows Server 2008
Существует несколько опций командной строки, доступных для настройки Window Server 2008 через сеть. Например, Windows Powershell, ServerManager.exe, или сервер telnet. Однако, проверенным и надежным способом, который так хорошо работал практически на всех типах устройств инфраструктуры, использующихся сегодня (включая Windows Server 2008, Cisco Routers, Linux серверы и т.д.) является SSH. В этой статье мы узнаем, как устанавливать SSH Server в Windows Server 2008.
Что такое SSH?
SSH – это безопасная оболочка (secure shell), стандарт, определенный в RFC 4251. Это сетевой протокол, который открывает безопасный канал между двумя устройствами, используя TCP порт 22. Этот канал также можно использовать для SFTP и SCP (безопасного FTP и защищенного копирования соответственно). Чтобы он работал, вам нужен безопасный сервер в системе, к которому вы подключаетесь, и безопасный клиент на клиенте, с которого вы подключаетесь.
Следует помнить, что SSH функционально совместим с различными платформами. К примеру, вы можете подключить SSH сервер на маршрутизаторе Cisco с клиента Windows, вы можете подключиться к серверу Linux с маршрутизатора Cisco, а также можете подключиться к Windows 2008 Server с клиента Linux.
Единственной возможной проблемой совместимости может стать тот факт, что существует две версии SSH, SSH версии 1 и SSH версии 2. Вы должны убедиться, что клиент и сервер поддерживают одну и ту же версию, чтобы знать, какую версию использовать при подключении. Обычно версии могут быть оговорены.
Хотя ни одна из ОС Windows не идет с SSH сервером или клиентом, их очень просто устанавливать.
Имея SSH сервер на своем Windows 2008 Server, вы можете:
- Удаленно иметь доступ к командной строке вашего Windows 2008 Server
- Управлять сервером через сеть, даже если вы не имеете доступа к интерфейсу GUI
- Удаленно управлять вашим Windows 2008 Server с любого устройства, имеющего SSH клиента
- Делать все это через зашифрованное соединение, которое может безопасно проходить даже через интернет
Какие опции сервера SSH доступны для Windows 2008 Server?
Существует ряд опций сервера SSH, доступных для Windows Server 2008. Вот лишь некоторые из тех, с которыми мне довелось иметь дело:
Как только вы запустили SSH сервер, вам понадобится SSH клиент для Windows. Вот несколько самых популярных SSH клиентов для Windows, которых мне удалось найти:
Как установить FreeSSHd — SSH сервер в Windows Server 2008?
Поскольку установка Free SSHd так проста по сравнению с другими опциями (особенно с OpenSSH в Windows), я выбрал эту версию, чтобы показать процесс установки Free SSHd. Помните, что FreeSSHd абсолютно бесплатен (как видно из его названия) для личного / некоммерческого использования, а также для коммерческого использования.
Чтобы начать процесс, я скачал FreeSSHd.exe на свою систему Windows Server 2008 и запустил загруженную программу. Графическая установка началась.
Я принял все параметры по умолчанию для установки и нажал «Установить», чтобы начать процесс.
По завершении я решил не запускать SSHd в качестве службы, однако вы можете выбрать этот вариант при желании.
Рисунок 1: Вы хотите запустить FreeSSHd в качестве службы?
Запустив FreeSSHd в качестве службы, он будет доступен независимо от того, вошли вы в консоль или нет. Я также решил выбрать создание частных ключей для SSH сервера.
Далее, я запустил ярлык FreeSSHd на рабочем столе, чтобы настроить и запустить SSH сервер.
Рисунок 2: Запуск FreeSSH приложения
Я заметил, что SSHd сервер уже работал.
Приложение FreeSSHd может предложить следующее:
- Возможности SSH сервера и Telnet сервера
- Опции запуска SSHd только в определенных интерфейсах
- Различные способы аутентификации, включая интегрированную NTLM аутентификацию на Windows AD
- Различные способы шифрования, включая AES 128, AES 256, 3DES, Blowfish и т.д.
- Опция создания защищенного туннеля в соединении
- Опциональный Secure FTP (sFTP) – для безопасного FTP, смотреть FreeFTPd website
- Возможность управлять пользователями и ограничивать доступ к безопасной оболочке, безопасному туннелю и безопасному FTP
- Возможность предоставлять доступ только определенным узлам или подсетям
- Возможность регистрировать в журнал все подключения и команды, выполненные через FreeSSHd
- Просмотр пользователей, подключенных в данный момент
- Автоматическое обновление FreeSSHd
Чтобы войти, мне понадобилось выполнить две вещи:
- Добавить новую пользовательскую учетную запись и разрешить доступ к командной строке SSH
- Открыть исключения в моем брандмауэре Windows Server 2008
Чтобы добавить нового пользователя, я перешел по вкладке «Пользователи» и нажал Добавить.
Я решил установить логин для моей учетной записи локального администратора Windows. Я установил авторизацию на NTLM. Так в базе данных FreeSSHd нет локального пароля, и если пароль администратора измениться в базе данных локальной учетной записи Windows, вам не придется менять пароль в базе данных учтенной записи FreeSSHd.
Я авторизировал этого нового пользователя на вход только в SSH.
Рисунок 3: Добавление SSHd пользовательской учетной записи с NTLM авторизацией
Рисунок 4: Новая пользовательская учетная запись SSHd добавлена
Второе, что мне нужно было сделать для того, чтобы позволить себе вход, это открыть исключения брандмауэра Windows. Хотя я мог вообще отключить брандмауэр Windows вместо того, чтобы открывать порты, конечно, самой безопасной опцией было оставить брандмауэр включенным и разрешить исключение для SSH ‘ TCP порт 22.
Для этого я перешел в меню Пуск -> Администрирование -> Брандмауэр Windows с расширенной безопасностью.
Рисунок 5: Открытие брандмауэра Windows с расширенной безопасностью
Далее, я нажал на входящих правилах, а затем Новое правило.
Рисунок 6: Добавление нового входящего правила
Далее я выбрал добавление правила порта.
Рисунок 7: Выбор добавления правила для порта
Я указал только TCP порт 22.
Рисунок 8: Определение только TCP порта 22
Воспользуйтесь умолчаниями чтобы Разрешить это соединение, примените ко Всем доменам, и назовите правило на свой вкус.
Чтобы протестировать подключение, я использовал SecureCRT со своей машины Windows XP на Windows Server 2008 сервер через SSH.
Для этого я подключился к серверу через IP адрес (или имя домена). Я выбрал опцию «Принять» сертификат сервера и сохранил его.
Рисунок 9: Подключение через SSH и вход с вашим именем пользователя и паролем Windows
Я вошел на сервер, используя логин и пароль администратора.
И, успех! Я смог получить доступ к серверу через SSH!
Рисунок 10: Успешное подключение к Windows 2008 Server через SSH
Резюме
SSH – это отличный инструмент для администраторов Windows Server 2008, желающих воспользоваться возможностями удаленного управления сервером. В этой статье вы узнали, как SSH может помочь вам, вы узнали о доступных вариантах установки SSH сервера и SSH клиента, а также о том, как устанавливать одну из этих опций, FreeSSHd.
Источник
Установка OpenSSH Server в Windows
Если вам понадобился SFTP/SSH сервер на Windows Server 2012 R2, то вы попали по адресу. Установим, запустим, настроим и протестируем OpenSSH Server в Windows Server 2012 R2.
Установка OpenSSH в Windows Server 2012 R2
Скачиваем последнюю версию дистрибутива OpenSSH:
Сейчас доступна версия v8.0.0.0p1-Beta. Скачиваю OpenSSH-Win64.zip .
Создаю директорию C:Program FilesOpenSSH , распаковываю в неё содержимое архива.
Запускаю powershell от имени администратора.
Выполняю скрипт установки:
Если произошла ошибка политики безопасности, то можно выполнить установку так:
powershell -ExecutionPolicy Bypass -File .install-sshd.ps1
В результате вижу ошибку:
Исправляется легко, захожу в папку C:ProgramData и создаю вручную директорию «ssh».
Снова пытаюсь сгенерировать ключи:
На этот раз процедура выполняется успешно.
Настраиваю владельца файлов и права доступа:
PowerShell -ExecutionPolicy Bypass -File .FixHostFilePermissions.ps1
На каждый вопрос отвечаю «A».
Открыть 22 порт
OpenSSH работает по порту TCP 22. Открою доступ в Firewall:
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH
То же самое можно сделать через GUI в оснастке Windows Firewall with Advanced Security .
Запуск службы OpenSSH
Открываю список служб:
Нахожу службу «OpenSSH SSH Server». В свойствах службы делаю автоматический запуск и запускаю её.
Проверим что 22 порт работает:
Проверка OpenSSH
Проверю с помощью WinSCP. Для доменного пользователя используется логин вида domainusername .
При первом входе появится окно:
Настройка доступа
Конфигурационный файл находится здесь: C:ProgramDatasshsshd_config .
Собственно, OpenSSH конфигурируется здесь. Например, чтобы разрешить доступ по OpenSSH определённой группе пользователей, допишу в конец файла:
DenyUsers *
AllowGroups my_domainmy_group_for_ssh_access
Если вам понравилась статья, то ставьте 👍🏻 каналу.
Пишите комментарии, задавайте вопросы, подписывайтесь.
Источник
Установка и настройка SFTP сервера (SSH FTP) в Windows на базе OpenSSH
С помощью официального пакета OpenSSH для Windows вы можете с легкостью организовать безопасный обмен файлами между клиентом и серверов Windows по защищенному протоколу передачи файлов SFTP (Secure FTP). В этой статье мы покажем, как с помощью Win32-OpenSSH установить SFTP сервер на Windows 10 или Windows Server 2016/2012R2.
Особенности протокола SFTP
Протокол SFTP (Secure File Transfer Protocol , Secure FTP или SSH FTP) это расширение протокола SSH, являющимся стандартом мира UNIX/Linux систем. Хотя с точки зрения пользователей он похож на FTP, но на самом деле это абсолютно другой протокол, не имеющий с FTP ничего общего. Данные между клиентом и сервером передаются по порту 22 через SSH туннель.
Основные преимущества протокола SFTP:
- Передача файлов и команд происходит внутри защищенной SSH-сессии;
- Для передачи файлов и команд используется одно соединение;
- Поддержка символических ссылок, функций прерывания, возобновления передачи, удаления файла и пр;
- Как правило, на каналах, где FTP работает медленно или с перебоем, SFTP-соединение работает более надежно и быстро;
- Возможность аутентификации с помощью SSH ключей.
Реализация SFTP в системах Windows
Исторически в операционных системах Windows отсутствуют встроенные средства для организации защищенного SFTP сервера. Для этих целей обычно использовались открытые или коммерческие решения, к примеру, Core FTP, FileZilla, CYGWIN, OpenSSH, FTP Shell, IPSwitch и пр. Однако несколько лет назад Microsoft выпустила свою версию порта OpenSSH для win32. Данный проект называется Win32-OpenSSH.
Рассмотрим процесс настройки SFTP сервера в Windows 10 и Windows Server 2016/2012 R2 с помощью пакета Win32-OpenSSH.
Установка Win32 OpenSSH в Windows 10 1803+/Windows Server 2019
В Windows 10, начиная с билда 1803, и в Windows Server 2019 пакет OpenSSH (как и RSAT) уже включен в операционную систему в виде Feature on Demand (FoD).
В Windows 10 и Windows Server 2019 вы можете установить сервер OpenSSH с помощью командлета PowerShell:
Add-WindowsCapability -Online -Name OpenSSH.Server*
Или с помощью DISM:
dism /Online /Add-Capability /CapabilityName:OpenSSH.Server
Или можно установить OpenSSH из графического интерфейса Windows 10 (Settings -> Apps -> Optional Features -> Add a feature -> Open SSH Server -> Install).
Исполняемые файлы OpenSSH находятся в каталоге:
Конфигурационный файл sshd_config находится в каталоге C:ProgramDatassh (каталог создается после первого запуска службы).
Файл authorized_keys и ключи хранятся в каталоге %USERPROFILE%.ssh.
Установка Win32 OpenSSH на Windows Server 2016/2012 R2
В предыдущих версиях Windows 10 и в Windows Server 2016/2012 R2 вы должны скачать и установить OpenSSH с GitHub (https://github.com/PowerShell/Win32-OpenSSH/releases). Нам нужна версия для 64 битной версии Windows: OpenSSH-Win64.zip (3,5 Мб).
- Распаковываем содержимое архива в целевой каталог, к примеру: C:OpenSSH-Win
- Запускаем командную строку PowerShell с правами администратора и переходим в каталог OpenSSH: Cd C:OpenSSH-Win
- Добавьте путь к каталогу OpenSSH в переменную окружения Path;
- Установите сервер OpenSSH: .install-sshd.ps1 (должно появиться зеленое сообщение “sshd and ssh-agent services successfully installed”);
- Сгенерируйте SSH ключи для сервера (нужны для запуска службы sshd): ssh-keygen.exe –A
, убедитесь, что создан каталог %programdata%ssh.
Тестируем SFTP подключение с помощью WinSCP
Попробуем подключиться к поднятому нами SSH серверу по протоколу SFTP. Для этих целей воспользуемся свободным клиентом WinSCP.
В окне настройки подключения выберите протокол передачи файлов SFTP, укажите имя сервера и данные учетной записи Windows, под которой осуществляется подключение (возможно также настроить авторизацию по ключам).При первом подключении появится окно с предупреждением о том, что ключ хоста отсутствует в локальном кеше.
Если все настроено правильно, клиент должен подключиться к SFTP серверу и отобразить список файлов в домашнем каталоге пользователя (по умолчанию каталог с профилем пользователя).
С помощью привычного интерфейса файлового менеджера можно безопасно копировать файлы между сервером и клиентом. Передача файлов будет осуществляться по защищённому протоколу SFTP.
Удаление службы Win32 OpenSSH
Чтобы корректно удалить службу Win32 OpenSSH из системы:
- Откроем консоль Powershell с правами администратора
- Остановим службу SSHD: Stop-Service sshd
- Удалим службу OpenSSD:Удалим ключи: .uninstall-sshlsa.ps1
Источник
I want to create a Proof of concept where i need to install SFTP on windows server 2008 R2 and then i need to write a program in C# to transfer file to that SFTP server
i dont know anything abut installing SFTP server but on c# i have some know how to send file to SFTP server
I have tried to use FileZilla but i am not able to configure it properly.
Please recommend me some tutorial to install SFTP server on windows 2008 R2 and to send file through c# to that server
asked Feb 9, 2014 at 10:31
1
You can try freeFTPd, found here:
http://www.freesshd.com/
With FileZilla you cannot set up an SFTP server.
For sending the file using C#, as far as I know .NET does not have any libraries for connecting to an SFTP server. You should use a third party library.
answered Feb 9, 2014 at 10:38
alfoksalfoks
4,2124 gold badges29 silver badges42 bronze badges
1
Posted by dustinreed 2014-07-22T14:33:36Z
I am wanting to run an SFTP server on windows server 2008 R2, but I need it to run as a service not an application. I have done some research on this, but everything I have found is application based and that wont work for me. I just need some help finding a product; Freeware is great , but paying is not an issue as long as it works correctly.
14 Replies
-
Long ago, we used WinSSHd, which worked well and as I recall ran as a service. I want to say it was around $100. It was pretty simple, just make sure the settings are as you’d like and open port 22.
I would point out that depending on what you’re after, there are better solutions, especially if end users are involved. I’ve since become a fan of LiquidFiles.
Was this post helpful?
thumb_up
thumb_down
-
You can run FIleZilla Server as a windows service,
Personally, I’d run it on Linux.
Was this post helpful?
thumb_up
thumb_down
-
Filezilla is only FTP/SSL not SFTP.
I have a tech support question open with WinSSHd to find out just that, because it isn’t in any of their documentation.
Was this post helpful?
thumb_up
thumb_down
-
zamarax
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.chipotle
-
xXGh057Xx
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.New contributor
chipotle -
I guess i read the wrong part, but this does say that I have to launch the application, I really need it to run as a background application.
Was this post helpful?
thumb_up
thumb_down
-
zamarax
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.chipotle
^ filezilla can be installed as a service.
Was this post helpful?
thumb_up
thumb_down
-
Last I looked, FileZilla server could do FTPS (FTP with SSL security) but not SFTP (SSH File Transfer Protocol.) Don’t confuse the two, they are different. FileZilla Client can be a SFTP or FTPS client.
For a SFTP server, Cygwin tools (https://www.cygwin.com Opens a new window) can be installed on a Windows server, and then you install OpenSSH and configure. If you are comfortable with the command line this works well.
If you want something with a GUI, I recently put Bitvise (http://www.bitvise.com Opens a new window) on a Windows server for backing up Cisco phone switch stuff. $99.95 for a single server. Honestly it was one of those need something now situations, need something that can be figured out by L2 helpdesk, don’t have time to remember how to configure Cygwin SSHD…$99 bucks is cheaper than my time. Do it!
Was this post helpful?
thumb_up
thumb_down
-
With sftp? I’ll look into it. Both methods on page dais I had to launch it.
Was this post helpful?
thumb_up
thumb_down
-
Bitvise looked good and I don’t mind paying the money, but did our run as a service? I looked at filezilla and it only looks to support ftp/ssl as a service. Cisco UCM is the exact reason I need this, but we have had issues and automatic nightly backups need to happen which is why I need the service
Was this post helpful?
thumb_up
thumb_down
-
»Last I looked, FileZilla server could do FTPS (FTP with SSL security) but not SFTP (SSH File Transfer Protocol.) Don’t confuse the two, they are different. FileZilla Client can be a SFTP or FTPS client. «
Yes I’m aware of the difference.
I just checked the FileZilla site and your right «Support for SFTP (SSH File Transfer Protocol) is not implemented in Filezilla Server.»
So looks like I was misinformed.
I checked around and it looks like similar questions have been asked on spice works. Check links for your answer.
http://community.spiceworks.com/topic/194189-anyone-know-of-any-windows-sftp-server-software
http://community.spiceworks.com/topic/170584-what-is-the-best-program-to-use-to-create-a-sftp-server
Was this post helpful?
thumb_up
thumb_down
-
WinSSHd is Bitvise; per the guide, it appears it runs as a service:
http://www.bitvise.com/wug-starting Opens a new window
I certainly don’t remember having to login to use it, and wouldn’t have used it as long as we did if I had to.
Was this post helpful?
thumb_up
thumb_down
-
found it finally. It runs as a service and is free. Only issue is that you have to manually start the service the first time or the GUI wont load to let you set the root path. Thanks for all the help.
I know the link says TFTP, but they have both
http://www.solarwinds.com/products/freetools/free_tftp_server.aspx Opens a new window
Was this post helpful?
thumb_up
thumb_down
Read these next…
Merging two domains with the same name?
Windows
It seems that a possible company merger is coming down the pipeline, but as luck would have it, the active directory domains have the same name (ie, domain.local)The domain I maintain is running server 2019 at a 2016/2019 functional level.The other domain…
How can I track changes to network adapter configuration
Windows
Ok, so we have a site where most of the users have local admin and they have a small group of users who «know about computers». The site runs pretty smoothly but we’re seeing a bunch of users who are able to function on the wired network but aren’t able …
Snap! — Cooling in Antarctica, Back to the Moon, Biological Clothing, AI Sci-Fi
Spiceworks Originals
Your daily dose of tech news, in brief.
Welcome to the Snap!
Flashback: February 3, 1986: The term “vaporware” is first used by Philip Elmer-DeWitt in a TIME magazine article (Read more HERE.)
Bonus Flashback: February 3, 1966: Luna 9 Lan…
Safety Glasses with Glasses
Networking
I’m going to be pulling some new wire soon through some dirty drop ceilings, and without fail, at some point I always get a piece of something in my eye at some point during the job.I’d like to avoid that this time.I have struggled to find safety glasses …
AD on-premise courses
IT & Tech Careers
Hello!We have a predominantly on-prem AD environment. Whilst we will be moving to M365 that will be in a while.We have a number of junior staff that need basic instruction in Active Directory and file/folder permissions. I recall many years ago the MC…
Create a Windows Server with SFTP/SSH support
To support chef solo and one click testing of chef cookbooks on Windows Server we need to be able to run windows cmd commands remotely via SSH and copy cookbooks from our client to the servers via SFTP.
Core Concepts
SFTP
SSH File Transfer Protocol (also Secret File Transfer Protocol, Secure FTP, or SFTP) is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream.
It is provided as standard on Linux servers but is not supported as part of the standard Windows Server Operating System. Don’t confused SFTP servers with Microsoft supplied FTPS, also know as SSL FTP. This is not compatabile with SFTP/SSH.
SSH
Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers.
It is provided as standard on Linux servers but is not supported as part of the standard Windows Server Operating System.
Start and Configure a Windows 2008 Server
1. Create a security group with port 22 and 3389 open.
2. Start the latest Amazon Windows 2008 Server using the security group. At time of writing ami-eb3b019f amazon/Windows_Server-2003-R2_SP2-English-64Bit-Base-2012.05.10
3. Logon as Adminstrator via RDP
4. Turn off the firewall. (Control Panel -> Firewall)
5. Change the Administrator Password. (Administrative Tools -> Computer Management).
Click on Local Users and Groups. Click on Users. Right Click on Administrator and select Set Password.
6. Set the computer name:
Go to C:Program FilesAmazonEC2ConfigService and double-click the Ec2ConfigServiceSettings application.
Your Windows instance displays the Ec2 Service Properties dialog box.
in the general tab make sure that set the compute name is checked.
7. Stop and start the server to get the ec2 configure changed.
See Using EC2Config Service
Install WinSSHD Server
To work with chef we need an SFTP Server that works on Windows 2008 and supports SFTP and SSH shell.
There are alot of old SFTP servers for windows out there but the only free one I was able to make work in Windows 2008 to support both SFTP file transfer and SSH remote commands was WinSSHD.
1. Download the the WinSSHD 5 installer from a href=»http://www.bitvise.com/winsshd-download»>http://www.bitvise.com/winsshd-download
2. Run the installer taking the defaults and install the free version.
3. Go into the WinSSHD management console and start the WinSSHD server.
4. Test you can access the SFTP server using say WinSCP.
5. Create an Image of the server.
Documentation on WinSSHD is available at http://www.bitvise.com/winsshd-doc-printable
NOTE: if you get error HostKeyMismatch trying to access the windows server via WinSCP
on your PC go to C:Users
.ssh and delete the known_hosts file.
NOTE: This setup uses password access to SFTP and SSH. It is also possible instead to setup public key. See the WinSSHD docs for details.
References
Using SSH on Amazon EC2 Windows servers
Setting up an Amazon EC2 Instance with an SSH Server, Mail Server, and an SSL Certificate
SFTP Server installation on Windows
2008 R2 64bit Domain Environment
1. Install Win 2008 R2 64bit standard Domain controller – ygnopadif501
2. Install Win
2008 R2 64bit standard Server (Join to the DC) – ygnopsftpif501
3. Install Win 7
64bit Professional (Client Test) – ygnoppc01
5. Copy installer
file to ygnopsftpif501 and run by local administrator rights.
6. You will need
internet connection to download installer
7. I made
secondary partition on ygnopsftpif501 put Cygwin on d:cygwin
11. vi
/etc/sshd_config and paste the following, yes.. Need to delete previous
contents.
# This sshd was
compiled with PATH=/bin:/usr/sbin:/sbin:/usr/bin
#Port 22
#AddressFamily
any
#ListenAddress
0.0.0.0
#ListenAddress ::
#Protocol 2
#HostKey
/etc/ssh_host_key
#HostKey
/etc/ssh_host_rsa_key
#HostKey
/etc/ssh_host_dsa_key
#HostKey
/etc/ssh_host_ecdsa_key
#HostKey
/etc/ssh_host_ed25519_key
#KeyRegenerationInterval
1h
#ServerKeyBits
1024
Ciphers
aes256-cbc,aes128-cbc,blowfish-cbc,3des-cbc,arcfour,cast128-cbc
MACs hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
#SyslogFacility
AUTH
#LogLevel INFO
#LoginGraceTime
2m
#PermitRootLogin
yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
RSAAuthentication
yes
PubkeyAuthentication
yes
AuthorizedKeysFile
.ssh/authorized_keys
#AuthorizedKeysFile %h/.ssh/authorized_keys
#AuthorizedPrincipalsFile
none
#AuthorizedKeysCommand
none
#AuthorizedKeysCommandUser
nobody
#RhostsRSAAuthentication
no
#HostbasedAuthentication
no
#IgnoreUserKnownHosts
no
#IgnoreRhosts yes
#PasswordAuthentication
yes
PasswordAuthentication no
#PermitEmptyPasswords
no
ChallengeResponseAuthentication no
#KerberosAuthentication
no
#KerberosOrLocalPasswd
yes
#KerberosTicketCleanup
yes
#KerberosGetAFSToken
no
#GSSAPIAuthentication
no
#GSSAPICleanupCredentials
yes
#UsePAM no
#AllowAgentForwarding
yes
#AllowTcpForwarding
yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset
10
#X11UseLocalhost
yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation
yes
#PermitUserEnvironment
no
#Compression
delayed
#ClientAliveInterval
0
#ClientAliveCountMax
3
#UseDNS yes
#PidFile
/var/run/sshd.pid
#MaxStartups
10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum
none
#Banner none
#Subsystem sftp
/usr/sbin/sftp-server
Subsystem
sftp internal-sftp
# Example of
overriding settings on a per-user basis
#Match User
anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
12. mkpasswd >
/etc/passwd
13. mkgroup >
/etc/group
14. vi /etc/passwd and
change the User ID / Group ID of the administrator
Administrator:*:0:0:U-DOMAIN Administrator,S-1-5-21-2764008837-3433102739-348656545-500:/home/tanlcl:/bin/bash
15. vi /etc/group
and add
root:S-1-5-32-544:0
16. Exist from Cygwin and run again with admin account.
cd /
mkdir sandbox
chmod 755 sandbox
chown
Administrator.root sandbox
mkdir
sandbox/home
chmod 755
sandbox/home
chown
Administrator.root sandbox/home
ls -las /
0 drwxr-xr-x+ 1
Administrator root 0 Apr 14 16:13
sandbox
cd sandbox
ls -las
0 drwxr-xr-x+ 1
Administrator root 0 Apr 14 16:13 home
E.g.
cd /
chown
Administrator.root cygdrive
chown
Administrator.root cygdrive/d [if cygwin is installed to D:]
chown
Administrator.root cygdrive/d/cygwin64
chown
Administrator.root cygdrive/d/cygwin64/sandbox
17. Create sftp
login account at DC.
$ mkpasswd -l
—username ygn001 >> /etc/passwd (If user is local)
$ mkpasswd -l -u ygn001 -D DOMAIN >> /etc/passwd
(if domain account)
$ mkdir
/sandbox/home/ygn001
$ chmod 700
/sandbox/home/ygn001
$ chown ygn001
/sandbox/home/ygn001
$ mkdir
/sandbox/home/ygn001/.ssh
$ chown ygn001
/sandbox/home/ygn001/.ssh
18. On client PC
run the followings.
19. Copy the
id_rsa.pub from client pc to ygnopsftpif501.
scp
~/.ssh/id_rsa.pub ygn001@10.10.10.2:/sandbox/home/ygn001/.ssh
20. cat
id_rsa.pub >> authorized.keys
chown ygn001
authorized.keys
chgrp “Domain
Users” authorized.keys
chmod 700 ~/.ssh
chmod 600
~/.ssh/authorized_keys
Or
You have to use
ssh-copy-id -i
/home/ygn001/.ssh/id_rsa.pub 10.10.10.2 <- authorized.keys=»» automatically.=»» command=»» create=»» file=»» span=»» this=»»>
cygrunsrv —start
sshd (You can start/stop sshd service from Windows services)
#ps -ef | grep sshd
#tail –f
/var/log/sshd.log
Test login to
SFTP server via ygn001
#sftp ygn001@10.10.10.2 (should directly reach to
/sandbox/home/ygn001)
Uninstall the
SSH-service
If you want to uninstall the SSH-service, open up Cygwin and execute commands:
cygrunsrv —remove sshd
Restrict User to
a directory
Open etc folder in your cygwin installation. Two file need a edit to to
implement chroot jail for user.
1. sshd_config
2. passwd
in sshd_config change below conigurtions
# override default of no subsystems
Subsystem sftp internal-sftp
ChrootDirectory /cygdrive/d/inetpub/ftproot
# Example of overriding settings on a per-user basis
Match User administrators
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
in passwd file
manually edit root user to change the group id (usually 544) to 0
for example as below :
SvcCOPSSH:unused_by_nt/2000/xp:0:545:U-WINDOWS-AU90FH5SvcCOPSSH,S-1-5-21-2943273595-299576109-709065550-1031:/var/:/bin/false
Restart OPENSSH service and Enjoy !
Steps to use local Linux admin to configure
new FatPC SFTP user who is a domain user:
=====================================================================================
1. Capture the
domain user’s SID into /etc/passwd (only a domain user can do this step. Use
your domain account to login FatPC, then run the Linux command)
mkpasswd -l -u ygnopr1
-D DOMAIN >> /etc/passwd
2. Edit the
/etc/passwd file to make this entry follow the format for local
users (refer to the xls sheet for instructions).
3. mkdir
/home/ygnopr1
4. mkdir
/home/ygnopr1/.ssh
5. cp the shared
id_rsa & id_rsa.pub files to /home/ygnopr1/.ssh
6. chgrp
«Domain Users» /home/ygnopr1/.ssh ************NOTE
7. chgrp
«Domain Users» /home/ygnopr1
8. Give ownership
for /home/ and /home//.ssh to the domain user. This
can’t be done at the Linux command line by the local admin, but can be done
using your AD account.
So use Windows
explorer to give ownership. You will need to enter your domain credentials when
prompted.
************NOTE
If there is an
error about group «Domain Users» not existing, then it means
«Domain Users» doesn’t exist inside /etc/group.
You should login
Windows using your domain account, run Linux Terminal & then the command
mkgroup -c >> /etc/group. After that,
logout &
login as Local Windows Admin & continue the config using Linux Terminal.
1.
Login
with ygnopr1 domain account, it will
create the home folder under /home/ygnopr1
2.
mkdir /home/ygnopr1/.ssh
3.
logoff
and login with zawhtet domain account
4.
copy
/home/zawhtet/.ssh/id_rsa and id_rsa.pub to /home/ygnopr1/.ssh
5.
change
permission for .ssh folder (chown – R ygnopr1 .ssh) (chgrp -R “Domain Users” .ssh)
6.
Login
with zawhtet domain user and check the /etc/passwd file
7.
If
there’s no record for ygnopr1 user you need to run this command
8.
mkpasswd
-l -u ygnopr1 -D DOMAIN >> /etc/passwd
9.
the
test login to sftp ygn001@10.10.10.2
On Client Side id_rsa private key should be 600.
I have a remote Windows 2008 machine and the task at hand is to share out parts of its filesystem via SFTP for a single user.
Were commercial software an option things would be easy but I want freeware.
After trying out several different candidates such as Core FTP Mini SFTP Server, SilverShield and freeFTPd none them really qualified — either connection issues, zero configurability or bugs.
Is there a free and stable SFTP server for Windows 2008 which works out of the box?
asked Aug 17, 2012 at 12:29
Another option would be to install OpenSSH using Cygwin. The attached instructions are for Windows XP/Vista but I don’t see why they wouldn’t work on Windows Server 2008.
Cygwin is a kind of middle layer that allows *nix software to be compiled and run on Windows without modification. It is extremely handy and brings a lot of other *nix goodness to Windows. Oh, yeah and Cygwin is open source and free.
answered Aug 17, 2012 at 13:21
GreenGreen
5563 silver badges9 bronze badges
1
After spending a few hours on the World Wide Web, turns out the answer is yes.
Meet KpyM Telnet/SSH Server which is a free, open source telnet/ssh server for Windows.
Installation is a breeze and it runs as a service.
The only caveat is the requirement to grant explicit access rights to SFTP home folder — KpyM authentication relies on Windows user accounts.
answered Aug 17, 2012 at 12:29
SaulSaul
4251 gold badge7 silver badges17 bronze badges
Why not use the freeSSHd ? We have been using this for our server and it does the job for us. It is free and easy to setup.
The download page is here http://www.freesshd.com/?ctt=download
After you install it, check in your taskbar, the application should be running and the icon is hidden in the taskbar next to the clock.
answered Oct 30, 2013 at 9:15
RosdiRosdi
8362 gold badges11 silver badges21 bronze badges
1
This is a free SFTP server which runs on Windows 2008 and is free for private use, or trial:
http://windsftp.weebly.com
answered Sep 25, 2013 at 22:52
CathalMFCathalMF
1331 silver badge7 bronze badges
You can try out Syncplify.me Server! as well. It’s free for non commercial use, and your single user scenario fits the free license technical limitations.
And unlike Cygwin/OpenSSH solutions this one is Windows-native, as per your request.
answered Apr 19, 2016 at 16:47
FjodrSoFjodrSo
2012 silver badges6 bronze badges
We need to transfer thousands of small htm files up to a web server running IIS7.5 on Windows Server 2008R2. The files are grouped in folders, each folder containing from 200 to 500 files. Remote Desktop Connection’s drag-drop isn’t working very well for this. Often it gets stuck at «calculating» and never seems to progress. So we would like to enable SSH file transfer on the server.
MadHatter
79k20 gold badges182 silver badges230 bronze badges
asked Apr 12, 2013 at 18:42
There is no native feature to «enable SSH file transfer.» IIS includes an FTP server, which has an FTPS feature, but nothing for SFTP (which, as you’re aware, is a sub-protocol of SSH.)
You’ll have to find a 3rd-party SSH server that supports SFTP; there are free ones and commercial ones for Windows. This site isn’t a good one to ask for product recommendations, please read the FAQ.
You could also enable WebDAV over HTTPS, and then you don’t even need anything on the client more specialized than a browser, or even a mapped drive from a Windows machine to the WebDAV server.
answered Apr 12, 2013 at 19:11
mfinnimfinni
35.9k3 gold badges52 silver badges86 bronze badges
3
Any protocol is going hurt because you are initiating thousands of connections over a network link, and each one will have network-delays as it starts up. Also WebDAV is a nice idea, but has proved a very temperamental thing for me before — this post and comment illustrate some example annoyances.
The simple workaround is compress the files up, copy the zip over RDP in one operation, then extract it on the server.
Regarding SSH servers, I’ve used http://www.freesshd.com/ before, but I don’t know it well enough to leave it running long-term, and https://filezilla-project.org/ as the client. They will also do for a one-off sort of copy.
answered Apr 13, 2013 at 1:49