如何在Windows上配置用户特定的主机文件 [英] How to configure user specific hosts file on Windows
问题描述
有许多用户可以访问的Windows Server 2003机器。他们每个都想配置自己的主机文件,将主机名重定向到某个IP地址。 (它们是具有相同主机名和每个用户拥有的不同IP地址的虚拟机。)
There is Windows Server 2003 machine which has many users to access. Each of them want to configure their own hosts file to redirect a hostname to certain IP address. (They are virtual machines with same hostname and different IP addresses owned by each user.)
C:\WINDOWS\system32\ driver \etc\hosts
C:\WINDOWS\system32\drivers\etc\hosts
此外,我们不能简单地要求用户使用IP地址进行连接,因为配置主机名需要用于应用程序。我们可以配置这个用户特定的主机文件或任何解决方法?
Also, we cannot simply ask users to use IP address to connect because the hostname is configured and need to be used in an application. Can we have this user specific hosts file configured or any workaround?
推荐答案
技术上这是不可能的...一个简单的程序工作周围可能是写一个脚本,用户登录用任何你想要的值替换文件。
由于主机文件中的大部分更改都是在运行时读取的,所以您应该可以实现您期望的结果
technically this is not possible...a simple programmatic work around could be to write a script and at user logon replace the file with whatever values you want. since most of the changes in the hosts file are read at runtime, you should be able to achieve the result you are expecting
这篇关于如何在Windows上配置用户特定的主机文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!