Now Select the Authentication and Authorization information or you can change it later also and finish the setup.ġ4. Here are you can select the option to use SSL or without SSL, I have selected no SSL:ġ3. After adding FTP site it will prompt you to fill some details about the site:Įnter the site name and create a folder to store the data and put the location under the physical path:ġ2. On the left side, you will find an option for “Site”, Right-click over site and click on Add FTP site:ġ1. Now we will configure the FTP site, click on the search box and open the IIS manager:ġ0. Now you can see the progress, FTP role and its service have been installed on this server, you may reboot this server.ĩ. Now following roles will be installed on this server, Click next to install:Ĩ. Now click next and move further to put a checkmark on FTP server, FTP Service and FTP Extensibility:ħ. Now click next and select the server as we have the host server selected here by default:ĥ. Click next to move further and Keep this installation type as selected below:Ĥ. Now it will open the wizard to install the FTP Roles on this server:ģ.Login to the server and open the server manager, here click on Add Roles and Features:. The steps below assume you are using IIS 8.5 that comes by default with Windows 2012 R2. You can test the FTP server, which should allow you to access files, content, and directories under the FTP root folder.Here you have the steps I followed to set up my FTP server in Windows 2012 R2. # Restart the FTP site for all changes to take effect Restart-WebItem "IIS:\Sites\$FTPSiteName" -Verbose You can verify this from the FTP root folder properties under the Security tab. The commands below set the NTFS permissions on the FTPRoot folder to allow the FTP user group to access the files: $UserAccount = New-Object ( "$FTPUserGroupName") $AccessRule = ::new($UserAccount, 'ReadAndExecute', 'ContainerInherit,ObjectInherit', 'None', 'Allow' ) $ACL = Get-Acl -Path $FTPRootDir $ACL.SetAccessRule($AccessRule) $ACL | Set-Acl -Path $FTPRootDir $SSLPolicy = '', '' ) Set-ItemProperty -Path $FTPSitePath -Name $SSLPolicy -Value $false Set-ItemProperty -Path $FTPSitePath -Name $SSLPolicy -Value $false SSL policy and NTFS permissions to the FTP root folderĬhange the SSL policy from Require SSL to Allow SSL connections. $Param = Filter = "/system.ftpServer/security/authorization" Value = accessType = "Allow" roles = "$FTPUserGroupName" permissions = 1 } PSPath = 'IIS:\' Location = $FTPSiteName } Add-WebConfiguration can also check these settings under IIS Manager > FTP Site > FTP Authorization Rules. # Enable basic authentication on the FTP site $FTPSitePath = "IIS:\Sites\$FTPSiteName" $BasicAuth = '.enabled' Set-ItemProperty -Path $FTPSitePath -Name $BasicAuth -Value $True # Add an authorization read rule for FTP Users. Now enable basic authentication on the FTP site and authorize the Windows group that contains the FTP user so it can access the FTP site. How to Authenticate FTP users to access FTP server data Then we will create a new local FTP user with a username and password: # Create an FTP user $FTPUserName = "FTPUser" $FTPPassword = $CreateUserFTPUser = $ADSI.Create( "User", "$FTPUserName") $CreateUserFTPUser.SetInfo() $CreateUserFTPUser.SetPassword( "$FTPPassword") $CreateUserFTPUser.SetInfo()Īdd the FTP user to the Windows group: # Add an FTP user to the group FTP Users $UserAccount = New-Object ( "$FTPUserName") $SID = $UserAccount.Translate() $Group = "WinNT://$env:ComputerName/$FTPUserGroupName,Group" $User = "WinNT://$SID" $Group.Add($User.Path) # Create the FTP site $FTPSiteName = 'Default FTP Site' $FTPRootDir = 'D:\FTPRoot' $FTPPort = 21 New-WebFtpSite -Name $FTPSiteName -Port $FTPPort -PhysicalPath $FTPRootDirĪfter running the cmdlet, you’ll see the FTP site and bindings in IIS Manager.Īfter creating a new FTP site, you can create a Windows user or group through which you can control the access to the FTP server.įirst, create the Windows local group: # Create the local Windows group $FTPUserGroupName = "FTP Users" $ADSI = "WinNT://$env:ComputerName" $FTPUserGroup = $ADSI.Create( "Group", "$FTPUserGroupName") $FTPUserGroup.SetInfo() $FTPUserGroup.Description = "Members of this group can connect through FTP" $FTPUserGroup.SetInfo() Note:We are choosing port 21, which is the default FTP port, but you can also specify any custom port for your FTP site. You can create a new FTP site using the New-WebFtpSite cmdlet by providing an FTP site name, root folder for your FTP site, and port number. Recommended Article: Tutorial Configure MongoDB Remote Access on Ubuntu 20.04 How to Configuring the site name, port, and root folder
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |