[lkml]   [1996]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Is determining the virtual hostname for a process possible?
On Tue, 4 Jun 1996 wrote:

> I've been virtual hosting a bunch of machines and I want to add some
> special functionalities that, at this point, don't seem to be
> possible, at least not with my current level of knowledge.
> My biggest desire is to be able to have a single physical machine that
> has two virtual domains and each of which has
> a user with a shell account whos username is john (but each with
> different uids).
> that way mail could be sent to either and
> and Mr. John One could log into and see
> his files and mail while Mr. John Two could log into and
> see his mail and files but neither could interfere with the other.
> Also if you telnetted to, getty would print...
> Trying
> Connected to
> Escape character is '^]'.
> login:
> instead of the real physical machines domain.
> I don't know enough yet about kernel level stuff dealing with this but
> I would think that maybe there is some way to do this with little or
> no modifications to the kernel.

It's not the kernel you need to modify to do this. It's in.telnetd and

> for instance NCSA's httpd and wuftpd can distinguish which domain is
> using them and I guess this is done by information received from the
> port connection. I would think that any process (such as getty) or
> the children processes could trace themselves back to the
> port/connection that they are originating from and determine what
> their hostname should be.

httpd and wuftpd can do this because when they open the socket
connection they pay attention to what the destination ip is that the
remote site is trying to hit. You can get an idea of how to do this by
taking a look at the wu.ftpd code. Go into the source directory an grep

> thus is it possible (in some way or another) to configure linux so
> that if you log in to a virtual domain and do a 'hostname' you would
> get the virtual hostname or if you did it a 'who am i' it would also
> give you the virtual hostname?

Sure if you configure hostname and every other userland program's code
to be virtual host aware. There's nothing in the kernel that is going to
help the userland programs to do this.

> Could we keep with each process's info (where/what ever that is) the
> IP address of the "machine" it is running on?

You might be able to, but this wouldn't affect the way userland programs
behave towards virtual domains.

> basically, in all, I would like to further segment a physical machine
> into virtual machines with finer granularity than is now possible.

Get ready to do alot of coding! :)

> Can this be done or is there something fundamental that prevents this?
> Please keep comments regarding sendmail aliasing as a solution to
> yourselves as I already know and implement this and it is not enough.
> especially when you get two clients whos name is bertrum and they both
> want their login name to be bertrum on their "machine". Don't laugh...
> it's not a hypothetical example for me. ugh :-)

Clients should realize this when they pay a virtual domain price versus
their own machine price. What you want to do is possible, but it would
take a good amount of hacking to the current in.telnetd, login, and
shadow suite system. The gist of it would be that each domain would use a
different passwd and group file, but the problem is while you would be
able to duplicate logical names this way, uid's and gid's could not be

B.J. Weschke, Technical Dir. <> Internet Images Worldwide
IIW is a full-service WWW presence creation agency--come check us out!!
<A HREF="">Internet Images Worldwide</A>

 \ /
  Last update: 2005-03-22 13:37    [W:0.037 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site