[성현모] DB 수정
This commit is contained in:
@ -1,8 +1,52 @@
|
||||
$FTPSiteName='CPXV2_FTP'
|
||||
$FTPRootDir='D:\FTP'
|
||||
$FTPPort='2121'
|
||||
$Username = "ALISFTP"
|
||||
$Password = ConvertTo-SecureString "Kefico!@34" -AsPlainText -Force
|
||||
|
||||
if (-Not (Get-LocalUser -Name $Username -ErrorAction SilentlyContinue))
|
||||
{
|
||||
New-LocalUser -Name $Username -Password $Password -FullName "ALISFTP" -Description "FTP User for IIS"
|
||||
Add-LocalGroupMember -Group "IIS_IUSRS" -Member $Username
|
||||
}
|
||||
|
||||
if (-Not (Test-Path $FTPRootDir)) {
|
||||
New-Item -Path $FTPRootDir -ItemType Directory -Force
|
||||
NEW-Item -Path "C:\inetpub\ftproot\LocalUser\ALISFTP" -ItemType Directory -Force
|
||||
}
|
||||
|
||||
$Acl = Get-Acl $FTPRootDir
|
||||
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
||||
"IIS_IUSRS", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
|
||||
)
|
||||
$Acl.SetAccessRule($AccessRule)
|
||||
Set-Acl -Path $FTPRootDir -AclObject $Acl
|
||||
|
||||
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
||||
"USERS", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
|
||||
)
|
||||
$Acl.SetAccessRule($AccessRule)
|
||||
Set-Acl -Path $FTPRootDir -AclObject $Acl
|
||||
|
||||
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
||||
"ALISFTP", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
|
||||
)
|
||||
$Acl.SetAccessRule($AccessRule)
|
||||
Set-Acl -Path $FTPRootDir -AclObject $Acl
|
||||
|
||||
New-WebFtpSite -Name $FTPSiteName -Port $FTPPort -PhysicalPath $FTPRootDir
|
||||
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/sites/site[@name='CPXV2_FTP']/ftpServer/security/authentication/anonymousAuthentication" -name "enabled" -value "True"
|
||||
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/sites/site[@name='CPXV2_FTP']/ftpServer/security/authentication/anonymousAuthentication" -name "enabled" -value "False"
|
||||
Set-WebConfigurationProperty -pspath "MACHINE/WEBROOT/APPHOST" -filter "system.applicationHost/sites/site[@name='CPXV2_FTP']/ftpServer/security/authentication/basicAuthentication" -name "enabled" -value "True"
|
||||
|
||||
Set-WebConfigurationProperty -Filter "system.ftpServer/firewallSupport" `
|
||||
-PSPath "MACHINE/WEBROOT/APPHOST" `
|
||||
-Name "lowDataChannelPort" `
|
||||
-Value 60000
|
||||
|
||||
Set-WebConfigurationProperty -Filter "system.ftpServer/firewallSupport" `
|
||||
-PSPath "MACHINE/WEBROOT/APPHOST" `
|
||||
-Name "highDataChannelPort" `
|
||||
-Value 62048
|
||||
|
||||
$FTPSitePath = "IIS:\Sites\$FTPSiteName"
|
||||
$BasicAuth = 'ftpServer.security.authentication.basicAuthentication.enabled'
|
||||
@ -12,7 +56,8 @@ $Param = @{
|
||||
Filter = "/system.ftpServer/security/authorization"
|
||||
Value = @{
|
||||
accessType = "Allow"
|
||||
users = "*"
|
||||
users = "ALISFTP"
|
||||
|
||||
permissions = 3
|
||||
}
|
||||
PSPath = 'IIS:\'
|
||||
|
||||
Reference in New Issue
Block a user