Unix Real Name/Comment Access

Alright, what I am trying to do is write a chroot script so that when a user logs in via SSH, their jail is set up appropriately. Now, to do this the way I want to (based on the filesystem layout I've constructed), I need to know what domain they are using.

I thought perhaps that I might just make their username <user>@<domain.com> but I can't have the '@' character in a username. Somehow Ensim does this I think but I am not sure how.

Another idea I had was to just use the real name/comment field in /etc/passwd. However, I can't seem to find anyway to access this value programmatically (specifically through a bash script). Either through an environment variable or an external program. Anyone have an idea?

 

 

 

 

Top