LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-20-2011, 01:28 PM   #1
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Rep: Reputation: Disabled
Telnet using PAM-RADIUS


I have a fc-14 linux and I can telnet into the system with /etc/passwd. After installation of pam-radius, I expect to see radius requests leaving for an external radius server. But I do not see any packeting (wireshark is turned on). Here is my setup:

1. fc-14.i686

2. installed pam-radius by "yum install pam-radius". pam_radius_auth.so is in /lib/security.

3. in /etc/pam.d/login, I have:
auth sufficient lib/security/pam_radius_auth.so
account required pam_permit.so
session required pam_permit.so

4. in /etc/raddb, file server is created with these contents:
192.168.1.2 mySecret 2

5. On the radius server, necessary configuration is set.

Can someone let me know what other configuration I need so that the system will use pam to authentication telnet user? Thanks in advance.

Last edited by rosect; 10-20-2011 at 01:29 PM. Reason: edited question
 
Old 10-20-2011, 03:07 PM   #2
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
do you have a /etc/pam.d/telnet file? if so i suggest you try pam_radius_auth.so there

which radius package is it you have installed on fc14? try testing radius auth via the radius auth test tool to make sure radius works as expected. once radius is verified then jump into the integration.

but you do know you posted this in the "security" section so you are probably gonna get a lot of "why are you even using telnet, use ssh".

Last edited by Linux_Kidd; 10-20-2011 at 03:20 PM.
 
Old 10-20-2011, 04:08 PM   #3
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thank you for your reply, Kidd. Here are my replies:

Kidd's suggestion 1: do you have a /etc/pam.d/telnet file?
My input: I created a /etc/pam.d/telnet. Same result -- no radius requests going out of the system.

Kidd's suggestion 2: which radius package is it you have installed on fc14?
My input: rpm -qa shows: pam_radius-1.3.17-2.fc14.i686.

Kidd's suggestion 3: try testing radius auth via the radius auth test tool
My input: I believe there is no radius setup on the system into which I want to telnet, right?

Kidd's suggestion 4: why are you even using telnet, use ssh.
My input: This is to support a legacy system. Compatibility considerations. SSH will also be implemented.

The problem is that I do not see pam-radius be invoked. Instead, passwd is used. (Yes, I can still telnet in). I also tried /etc/sshd. I still do not see radius requests going out. Please advise. Thank you.

Last edited by rosect; 10-20-2011 at 05:43 PM.
 
Old 10-20-2011, 08:55 PM   #4
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
can you post the output of "ls /etc/pam.d/"

install freeradius-utils-2.1.9-3.fc14.i686.rpm and use the radtest utility to test radius functionality between your "telnet" box and the radius server 192.168.1.2

you can google "man radtest" to see how it works, etc. let us know when you validate radius is working as desired.
 
Old 10-20-2011, 09:15 PM   #5
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thank you, Kidd. Here is the radtest result:

[root@1950]# radtest pam mc921 192.168.1.2:1812 8855 wlan
Sending Access-Request of id 116 to 192.168.1.2 port 1812
User-Name = "pam"
User-Password = "mc921"
NAS-IP-Address = 127.0.0.1
NAS-Port = 8855
rad_recv: Access-Accept packet from host 192.168.1.2 port 1812, id=116, length=20

/etc/pam.d: you can see
atd gnome-screensaver reboot sudo-i
authconfig halt remote su-l
authconfig-gtk ksu run_init system-auth
authconfig-tui login runuser system-auth-ac
chfn login.org runuser-l system-config-authentication
chsh newrole selinux-polgengui system-config-date
config-util other setup system-config-keyboard
crond passwd smartcard-auth system-config-network
cvs password-auth smartcard-auth-ac system-config-network-cmd
fingerprint-auth password-auth-ac smtp system-config-selinux
fingerprint-auth-ac polkit-1 smtp.sendmail system-config-users
gdm poweroff sshd telnet
gdm-autologin ppp wireshark gdm-fingerprint radiusd su xserver gdm-password
sudo
 
Old 10-20-2011, 09:28 PM   #6
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
ok, did you see this radius test in wireshark??

next, try putting your pam statement in /etc/pam.d/sshd, then try ssh login and you should see radius traffic in wireshark, btw, do you have a capture filter in wireshark, if so please post it.

most daemon services put a file in pam.d, did you verify that your telnetd is pam-a-fied ?

Last edited by Linux_Kidd; 10-20-2011 at 09:30 PM.
 
Old 10-21-2011, 11:05 AM   #7
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Yes, I tried sshd. Same. No radius requests going out. I do have wireshark with RADIUS filter set. But there are none radius packets captured.

Wireshark did catch requets when radtest is tried.

Did you mean "your telnetd is pam-a-tied" ? Could you let me know how to verify? Thank you.

Further testing. I replaced "sufficient" with the following:
[success=done ignore=ignore default=die].

In this case, I can not ssh in at all !. If I change "default=die" to "default=ignore", ssh is successful. So, it seems to me that the .so library returned some "weird" value!

Last edited by rosect; 10-21-2011 at 11:35 AM.
 
Old 10-21-2011, 11:19 AM   #8
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
run ldd on your telnetd (or whatever binary is running your telnet service, etc).

example for sshd on my rhel 5.7:
[root@host ~]# ldd /usr/sbin/sshd |grep pam
libpam.so.0 => /lib/libpam.so.0 (0x00420000)

this shows that sshd is linked to the PAM library, hence its "pam-a-fied".

which telnet package is installed?

please post the wireshark capture filter you are using, and did you select the correct interface to capture on? your capture filter should be "port 1812" or "host 192.168.1.2". what host does wireshark run on?

is there anything in var/log/messages that might suggest whats going on?

Last edited by Linux_Kidd; 10-21-2011 at 11:34 AM.
 
1 members found this post helpful.
Old 10-21-2011, 05:16 PM   #9
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Hi, Kidd, I turned on debug and did see error returned by the .so. Basically messages say the .so could not read server IP from config file. Well, I just retyped the IP and that solved the problem! Not sure why the previous IP was "so bad".

I sincerely thank you very much for your advice as to debugging the issue. You have a good weekend.
 
Old 10-21-2011, 06:18 PM   #10
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
hmmmm, that was easy.
 
Old 11-18-2011, 05:45 AM   #11
Lorens
LQ Newbie
 
Registered: Oct 2011
Posts: 11

Rep: Reputation: Disabled
Just a simple question, did you know how to configure pam to let non-local users log in by RADIUS?
 
Old 11-18-2011, 02:04 PM   #12
rosect
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Lorens, if I understand your question correctly, I believe you are asking how to configure telnet/ssh using PAM-RADIUS.

One variable we have to deal with is the Linux itself. For different flavors, configuration files to be used could be different. I realized this when I was doing Internet search for solutions. Because I do not know about your Linux (REDHAT or SUSE or something-else.), I have to use my setup as an example. Mine is Fedora 14, which is RHEL6.

For Telnet:
1. Assume you have installed and started telnet service. (telnet is not by-default installed and enabled.)
2. In /etc/pam.d/remote, add the following, if they are not there:
auth sufficient \
/lib/security/pam_radius_auth.so \
conf=/etc/sysconfig/pam_radius
account required /lib/security/pam_permit.so
session required /lib/security/pam_permit.so

3. In /etc/sysconfig/pam_radius, add these:
192.168.1.2 radius-shared-secret 2


For SSH:
1. In /etc/pam.d/sshd, add the same lines.

Note: the pam_radius in /etc/sysconfig is what I added.

And last, good luck!
 
  


Reply

Tags
fedora, linux, pam, radius, telnet



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PAM with RADIUS and TACACS+ rosect Linux - Security 2 11-21-2011 10:38 PM
pam radius authentication danieldinu Linux - Security 2 07-17-2009 01:56 PM
Radius PAM.D Module interpol Linux - Security 5 02-27-2007 03:29 AM
PAM Radius Module interpol Linux - Networking 1 02-23-2007 09:37 AM
PAM Radius Module interpol Linux - Security 1 02-23-2007 09:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration