LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-16-2016, 09:15 AM   #1
Strykar
Member
 
Registered: Apr 2008
Distribution: Slackware64, OpenBSD, Debian, Arch
Posts: 42

Rep: Reputation: 6
SSH-key + RADIUS-PAM auth without 2 instances of sshd?


How can I provide ssh key-only authentication on port 22 and RADIUS-PAM-only authentication on another port without running 2 instances of sshd? This is on Debian-8.5

I was told it's possible on OpenBSD via login.conf, but linux has login.defs which is sytem auth only and RADIUS requires PAM which login.defs won't speak to.

If it's not possible, how can I setup a 2nd instance of sshd?
I tried setting up a 2nd instance with a simple service from ports, and that won't auto start. Besides sshd seems to have 3 service definitions in /lib/systemd/system:
Quote:
$ ls /lib/systemd/system/*ssh*
/lib/systemd/system/ssh.service /lib/systemd/system/ssh@.service /lib/systemd/system/ssh.socket
 
Old 08-16-2016, 02:53 PM   #2
Strykar
Member
 
Registered: Apr 2008
Distribution: Slackware64, OpenBSD, Debian, Arch
Posts: 42

Original Poster
Rep: Reputation: 6
It's possible using the Match LocalPort directive in sshd_config.
Obviously you need to setup RADIUS and PAM and make sshd listen on the extra hostort

# RADIUS auth
Match LocalPort 2222
Banner none
PasswordAuthentication yes
AllowTcpForwarding yes
DenyUsers root
DenyGroups root wheel
MaxSessions 2
PermitUserRC no
X11Forwarding no
 
  


Reply

Tags
debian jessie, pam.d, radius, sshd, sshd_config



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
/etc/pam.d/system-auth-ac vs. /etc/pam.d/password-auth-ac vs. /etc/pam.d/sshd christr Red Hat 2 08-01-2014 07:08 PM
multiple auth methods in pam.d/sshd? ghughes5669 Linux - Security 1 07-01-2014 05:26 AM
Configure PAM, Radius for ssh hamedhmd Linux - Security 0 05-19-2012 02:15 AM
PAM help (multi-factor SSH auth using RADIUS and LDAP) jg141 Linux - Security 0 04-17-2012 12:30 PM
pam radius auth in slackware ?? Barx Slackware 1 04-30-2005 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:17 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