3

I have a file in /etc named radius which contains the user account details similar to /etc/passwd but of Radius users. How do I configure /etc/nsswitch.conf to check /etc/radius in addition to checking /etc/passwd when searching for local files? For example I have a line in my /etc/nsswitch.conf which says

passwd:     files nis

files here searches only in /etc/passwd. How do I make it search other files?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • you can't use nsswitch.conf to remplqce /etc/passwd. this file is intented to switch between localfile, nis or dns. if /etc/radius is similar to passwd, just do a `cat /etc/radius >> /etc/passwd` – Archemar Oct 16 '14 at 12:56
  • 2
    I don't want the entries to be in /etc/passwd. I dont want to replace /etc/passwd but I want this file to be searched too in addition to /etc/passwd – user1449951 Oct 16 '14 at 13:00
  • can you give a sample of /etc/radius ? – Archemar Oct 16 '14 at 13:17
  • test::161:100:Test User:/:/bin/bash I have added a test user in radius server in users file like test Cleartext-Password:"test" – user1449951 Oct 16 '14 at 13:29
  • this look like /etc/passwd entry, you have to merge with /etc/passwd. I don't think of any switch in nsswitch.conf that will "add" /etc/radius to /etc/passwd. – Archemar Oct 16 '14 at 14:38
  • you could clone the nss_files library and make the cloned one search `/etc/radius` (see http://unix.stackexchange.com/questions/204350/) – sendmoreinfo Feb 10 '16 at 20:54

0 Answers0