Get FTP virtual hostname in IFtpHomeDirectoryProvider.GetUserHomeDirectoryData? - iis-7

I am able to set the FTP home directory based on username or site name. Is it also possible to get the virtual hostname and use that?
It is possible to access this in IFtpLogProvider.Log using FtpLogEntry.HostName. I just can't see a way to do it in GetUserHomeDirectoryData.
Thanks,
Barry

Related

NGINX authentication with role based access

So first of all, I'm very new to NGINX, Docker etc..
But here is my scenario:
I've created a 2 docker images which display a simple website, website1 and website2.
Both of them are created in a dockerfile, using the nginx image.
I put them in 2 seperate containers.
By visiting localhost:8080 I got website1.
By visiting localhost:8081 I got website2.
Then I wanted just 1 entrypoint (localhost) and by using a /, going to my websites.
So I created a new container, called reverseproxy.
I used default.conf of NGINX to proxy pass to my containers.
I did the following:
in default.conf, I have 3 locations. localhost (which shows the default NGINX page)
localhost/website1, which proxy passes this to my website1
localhost/webiste2, which proxy passes this to my website2
I put all of this is a docker-compose.yaml file and it runs just fine.
Then for website1, I wanted basic authentication. With using apache-utils and adding basic authentication to my /webiste1 and /website2 end points, it works great.
But now I want to restrict access to my endpoints (website 1 and website 2) based on specific roles.
So when I visit website1, enter credentials using basic_auth, I want to be able to check whether this user has the role of user for example.
And when visiting /website2, I want to be able to login, but then restrict access because this user may not access this website, only with the "admin" role for example.
I've been stuck on this for a few days now...
Anyone have any idea?
Just some extra information: I don't want to use Kubernetes. I know this has RBAC (Role based Access Control) but I'd like to keep it more simple.
Thanks for your input in advance :)
Completely stuck..
You can use and leverage the OAuth-proxy : https://github.com/oauth2-proxy/oauth2-proxy
Here is the demo on Github if you are looking for same : https://github.com/deskoh/nginx-oauth2-proxy-demo
You can also use the ngx_openresty

Can't get to the root on juniper ssg5

Can't get to the root on juniper ssg5
After i enter my login username and password I'm stuck on this prompt
'my-fw->'
my-fw-> copy
^------unknown keyword copy
my-fw-> show
^------unknown keyword show
my-fw-> configure
^-----------unknown keyword configure
why can't i get to root#my-fw-> or root#my-fw-# prompt. What can i do to get to root. I'm using putty to console to the juniper ssg5.
[Note- I'm trying to backup config to a tftp server where i require to get to the root access]
You don't need root access. root is an special account and all / most of the commands works without root account. Any account which has privileges to perform configuration changes, can apply the command to archive the configuration on given site.
See junos-os-login-classes-overview for user privileges.
The prompt we get is in this format: user#hostname> Ref
If there is no hostname defined, then it is just: user>
Once you make sure that you have logged in with correct user, i.e. it has requirement permissions, you should be able to execute those commands and apply archival configuration.
I have a working solution, let me know if above doesn't help.

File.copy over lan with credentials

I have to copy a file to a pc in a lan network. Let's say I have to copy a file from 192.168.1.2 to 192.168.1.3. I have to copy in a folder named 'folder'.
So I have a folder with a path 192.168.1.3/folder. This folder has credentials username and password.
I saw already ways to do this like the following:
using (new Impersonator("username", "domain", "pass"))
{
File.Copy(#"192.168.1.2\file.txt", #"192.168.1.3\folder\file.txt");
}
what is the domain in this case?
Domain is (usually) the name of the Active Directory domain. You can open the Control Panel, make sure you're in icon view, click on System, then view the domain in "Computer name, domain, and workgroup settings". If it ends in .local, .net or .com or something similar you may be able to leave the part off.
By the way, usually when using UNC network paths like that, you'll lead with a double slash before the computer name. Ex:
using (new Impersonator("username", "domain", "pass"))
{
File.Copy(#"\\192.168.1.2\file.txt", #"\\192.168.1.3\folder\file.txt");
}

Tilde prefix returns invalid home directory

I am trying to find the home directory of users on a UNIX (Solaris/AIX) box using
echo ~username
This does return the home directory for all valid users. For some reason this command also outputs home directory which are non-existent for few users who seem not to have logon access to that server.
For eg. the above command would return below for a non-existent user -
/home/username
What I expected was
~username
as output for a user with no access and that does happen with certain usernames.
This makes me think what could be causing a difference between different users who do not have access to this server. Has this something to do with LDAP?
Nothing I can find in /etc/passwd too.
getent and finger commands were outputting a default home directory for a non-existent user (not retrieved using ldaplist) because the requests were handled through an intermediate access control mechanism such as Cisco SA Control for role based access control.

Active Directory and Network ID

I know that I can get the fully qualified domain name by using the windows NT network domain. I'd like to do the reverse:
Ex: User.Identity.Name = "slaterock\fflintstone";
Active Directory returns fully qualified domain name of slaterock.bedrock.us.com.
I would like to be able to get the domain portion of User.Identity.Name by querying Active Directory (LDAP) by that user. I would be using the user's email address:
(&(objectClass=user)(objectCategory=Person)(mail=fred.flintstone#slaterock.com))
I have no trouble returning the AD attributes, but I cannot figure out an absolute link between the attributes I have and the domain name returned in User.Identity.Name. I see parts of it in the domain components (DC=slaterock,DC=bedrock,DC=US,DC=blah,blah) but I need the direct link.
Thanks
First, a bit of terminology to be clear (and to help any searches you do):
the 'slaterock' in 'slaterock\fflintstone' is the NetBIOS Domain Name for the domain.
'DC=slaterock,DC=bedrock,DC=US,DC=blah,blah' is the defaultNamingContext for the domain.
CN=fred flinstone,OU=Quarry1,DC=slaterock,DC=bedrock,... is the user account's distinguishedName.
To translate from the user's distinguishedName to the NetBIOS Domain Name of their domain:
get the user account's distinguishedName and chop it up to get the defaultNamingContext.
Then do a search against the container: "CN=Partitions,CN=Configuration,DC=JohnLewis,DC=co,DC=uk"
for an object with an nCName value that matches the defaultNamingContext from above.
Get the nETBIOSName attribute of that object and you've got what you're after.

Resources