From: Aman Sharma <amansh.sharma5@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SELinux <selinux@tycho.nsa.gov>
Subject: Re: PAM Security related issue
Date: Thu, 14 Dec 2017 12:48:42 +0530 [thread overview]
Message-ID: <CAPMH7-9F4H_e-VmHqOzdpCq0JkN-y71-ye152yBixZrHHmOd5g@mail.gmail.com> (raw)
In-Reply-To: <1513192514.25026.5.camel@tycho.nsa.gov>
[-- Attachment #1: Type: text/plain, Size: 3206 bytes --]
Hi All,
Below is the output of semanage USer command output for sftpuser:
*specialuser_u user s0 s0
sysadm_r system_r*
and for command semanage login -l , output is :
*sftpuser specialuser_u s0 **
*and also, after adding the debugging option, its showing the below error
message as :*
Dec 13 15:46:10 cucmSUB authpriv 3 sshd: pam_selinux(sshd:session): Unable
to get valid context for sftpuser
Dec 13 15:46:10 cucmSUB authpriv 5 sshd: pam_selinux(sshd:session): Open
Session
Dec 13 15:46:11 cucmSUB authpriv 7 sshd: pam_selinux(sshd:session):
Username= sftpuser SELinux User= specialuser_u Level= s0
Dec 13 15:46:11 cucmSUB authpriv 3 sshd: pam_selinux(sshd:session): Unable
to get valid context for sftpuser
also Selinuxdefcon command is showing error while running for sftpuser i.e.
*sudo /usr/sbin/selinuxdefcon sftpuser system_u:system_r:sshd_t:s0*
*/usr/sbin/selinuxdefcon: Invalid argument*
*Please let me know your comments on this.*
*Thanks*
*Aman*
On Thu, Dec 14, 2017 at 12:45 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Wed, 2017-12-13 at 21:40 +0530, Aman Sharma wrote:
> > Hi Stephen,
> >
> > Yes , I am using open env_params for it. But for this, my sftp is not
> > working and getting the below error message :
> >
> > Dec 13 13:00:00 aman authpriv 3 sshd: pam_selinux(sshd:session):
> > Unable to get valid context for sftpuser
> > Dec 13 13:00:00 aman authpriv 6 sshd: pam_unix(sshd:session): session
> > opened for user sftpuser by (uid=0)
> >
> > Please let me know if you have any idea on this.
>
> Do you have any semanage login mapping for sftpuser or is it just using
> the __default__ entry? (what does semanage login -l show) How was
> sftpuser created?
>
> You could add the debug option on the pam_selinux.so line to try to get
> more information.
>
> You could run selinuxdefcon to query what context would be used for
> that user, e.g.
> selinuxdefcon sftpuser system_u:system_r:sshd_t:s0-s0.c0123
>
> >
> > On Wed, Dec 13, 2017 at 8:54 PM, Stephen Smalley <sds@tycho.nsa.gov>
> > wrote:
> > > On Tue, 2017-12-12 at 23:47 -0500, Aman Sharma wrote:
> > > > Hi All,
> > > >
> > > > just wanted to know the meaning of line session required
> > > > pam_selinux.so open env_params added in /etc/pam.d/sshd file.
> > > > Actually I am facing one issue related to this. When I changed
> > > this
> > > > env_params to restore then my Sftp is not working.
> > > >
> > > > Can anybody Please guide me on this.
> > >
> > > man pam_selinux describes the options and what they mean.
> > > Why did you change it to restore? Per the man page, restore is to
> > > temporarily restore the contexts and would be a separate entry in
> > > the
> > > PAM stack before the module that needs the original contexts,
> > > followed
> > > by a pam_selinux.so open env_params after that module to set them
> > > up
> > > again. But don't use restore unless you actually need it for some
> > > reason.
> > >
> > >
> > >
> > >
> >
> >
> >
> > --
> >
> > Thanks
> > Aman
> > Cell: +91 9990296404 | Email ID : amansh.sharma5@gmail.com
>
--
Thanks
Aman
Cell: +91 9990296404 | Email ID : amansh.sharma5@gmail.com
[-- Attachment #2: Type: text/html, Size: 7302 bytes --]
next prev parent reply other threads:[~2017-12-14 7:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 4:47 PAM Security related issue Aman Sharma
2017-12-13 9:14 ` Aman Sharma
2017-12-13 15:24 ` Stephen Smalley
2017-12-13 16:10 ` Aman Sharma
2017-12-13 18:17 ` Dominick Grift
2017-12-13 19:15 ` Stephen Smalley
2017-12-14 7:18 ` Aman Sharma [this message]
2017-12-14 8:16 ` Dominick Grift
2017-12-14 13:49 ` Stephen Smalley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPMH7-9F4H_e-VmHqOzdpCq0JkN-y71-ye152yBixZrHHmOd5g@mail.gmail.com \
--to=amansh.sharma5@gmail.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.