# FreeBSD, PAM and Radius



## ganesh (Jun 8, 2011)

I'm using a FreeBSD machine in which PAM is taking care of authentication. All the users are authenticated using PAM. Users whose information is configured in Radius server are also getting authenticated successfully. We have some configuration to do that in PAM something like


```
auth required pam_radius_auth.so ....
```

My requirement is that after authentication, I need to fetch the group of the user and store it in a file. The *groups* command is fetching the information of the local users. But I'm getting 
	
	



```
user not found
```
 when I try to find the non-local user's (residing in Radius server) group. I'm new to FreeBSD, Radius and PAM. 

Does anybody know whether I can use any other command to get this information in FreeBSD?

Thanks in advance


----------



## SirDice (Jun 8, 2011)

Have a look at getent(1).


----------



## ganesh (Jun 8, 2011)

Thanks for the reply. I tried using the getent command in FreeBSD. But the command doesn't seem to be existing. The version of the FreeBSD is 6.3. Please let me know from which version of FreeBSD the getent command is available.


----------



## SirDice (Jun 8, 2011)

Ah, yes. According to the man page this command was introduced with FreeBSD 7.0.

Probably the only other way would be to query the RADIUS server directly.

Keep in mind that 6.3 has been end-of-life for quite some time now.

Edit: Just thought of something. You could parse the output of [cmd=]id -a[/cmd]or [cmd=]id -a <username>[/cmd]


----------

