LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-09-2008, 03:01 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
/etc/issue banner on ssh logins


Can anyone help me configure OpenSSH/PAM to display the /etc/issue warning banner on interactive ssh logins but not on non-interactive ssh sessions?

i.e.,

ssh login@machine
banner is wanted

ssh login@machine df -k
banner is NOT wanted

Currently I see the banner on all ssh sessions. The system was built from a standard JumpStart image that our company uses for lab boxes, and I don't know all the details about the original setup. I am feeling my way around the box to see how things were installed.

I realize I can kill the banner on the non-interactive stuff by redirecting stderr to /dev/null, but that is not the solution I am after.

The "Banner" line in sshd_config is currently commented out, so I believe the banner I'm seeing now (in all cases) must be coming from PAM. The system is set up to use a single pam.conf file (I think, because I can't locate any other PAM configuration stuff except this file).

In pam.conf I don't see any specific ssh config, so it must be falling back to "login" or "other". Nor do I see any calls to pam_issue, so some other module must be calling that by default. Since the banner shows up before login credentials are asked for it must be one of the first PAM modules doing this - I suspect pam_authtok_get. Per the manpage, pam_authtok_get implements pam_sm_authenticate which apparently accepts a flag PAM_SILENT, which might be what I'm after. I'm not sure.

So, how do I make what I want to do work? I've seen it done on other systems (from the user perspective, not how it was actually implemented). I am not an "officially trained" Solaris sysadm but I've been called on to maintain this lab system. I do not know much about PAM. I may be off base in where I'm looking, so I'm asking for some help.

Thanks!

Code:
#
# uname -a
SunOS tsdshire01 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-V240
#
# telnet localhost 22
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.4
^C
#
# grep issue /etc/profile
#
# grep issue /etc/ssh/sshd_config
#Banner /etc/issue
#
# egrep -i "^PAM" /etc/ssh/sshd_config
PAMAuthenticationViaKBDInt yes
#
# find /etc -name "*pam*" -print
/etc/pam.conf
#
# grep issue /etc/pam.conf
#
# grep ssh /etc/pam.conf
#
# egrep "^(login|other)" /etc/pam.conf
login   auth requisite          pam_authtok_get.so.1
login   auth required           pam_dhkeys.so.1
login   auth required           pam_unix_auth.so.1
login   auth required           pam_dial_auth.so.1
other   auth requisite          pam_authtok_get.so.1
other   auth required           pam_dhkeys.so.1
other   auth required           pam_unix_auth.so.1
other   account requisite       pam_roles.so.1
other   account required        pam_projects.so.1
other   account required        pam_unix_account.so.1
other   session required        pam_unix_session.so.1
other   password required       pam_dhkeys.so.1
other   password requisite      pam_authtok_get.so.1
other   password requisite      pam_authtok_check.so.1
other   password required       pam_authtok_store.so.1
#
 
  


Reply



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
hide ssh banner shafey Linux - Security 3 04-14-2013 05:59 PM
SSH Login Banner Display raiden4201 Linux - Newbie 11 12-08-2008 04:41 PM
How to change ssh banner in sshd.config pAn1k Linux - Networking 2 03-24-2005 04:46 PM
SSH banner design garnser Linux - Software 1 10-16-2004 02:07 AM
change the banner for ssh [cacheflow] Linux - Security 5 09-16-2002 03:03 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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