<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PAM limits won't work on SFTP or SCP in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748340#M43549</link>
    <description>How are you setting up your limits in PAM?&lt;BR /&gt;</description>
    <pubDate>Fri, 04 Feb 2011 15:19:37 GMT</pubDate>
    <dc:creator>Alzhy</dc:creator>
    <dc:date>2011-02-04T15:19:37Z</dc:date>
    <item>
      <title>PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748339#M43548</link>
      <description>I'm trying to setup an SFTP/SCP server that will be used for uploading and downloading files. To prevent file locking I want to limit the SCP/SFTP sessions to one active session per user. But PAM limits.conf doesn't seem to work for SFTP/SCP, allthough it works fine for SSH (Putty) sessions. Am I missing something or is this a limitation of PAM limits?&lt;BR /&gt;b.t.w. I'm using Debian 5 with OpenSSH 5.1.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2011 19:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748339#M43548</guid>
      <dc:creator>wobbe</dc:creator>
      <dc:date>2011-02-03T19:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748340#M43549</link>
      <description>How are you setting up your limits in PAM?&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Feb 2011 15:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748340#M43549</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-02-04T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748341#M43550</link>
      <description>/etc/security/limits&lt;BR /&gt;&lt;BR /&gt;test     hard     maxlogins     1&lt;BR /&gt;&lt;BR /&gt;/etc/ssh/sshd_conf&lt;BR /&gt;&lt;BR /&gt;UsePam yes&lt;BR /&gt;&lt;BR /&gt;like I said, this works for SSH.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Feb 2011 15:35:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748341#M43550</guid>
      <dc:creator>wobbe</dc:creator>
      <dc:date>2011-02-04T15:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748342#M43551</link>
      <description>Looks like OpenSSH on Debian 5 does not write SFTP or scp sessions into /var/run/utmp. Since SFTP and scp sessions normally don't have a PTY allocated to them and the utmp entry pretty much requires a TTY/PTY name, this is somewhat understandable.&lt;BR /&gt;&lt;BR /&gt;Apparently the PAM limits module defines a session as "a login entry in the utmp file". That's simple and matches general Unix behavior, but it also means that any sessions with no utmp entry are not counted in PAM session limits.&lt;BR /&gt;&lt;BR /&gt;By looking at the source code of OpenSSH, the utmp file is updated in session.c, in function do_pre_login(). That function in called from function do_exec_pty() only, which is executed if the session has a PTY allocated. If the session has no PTY, the function do_exec_no_pty() is used instead, and thus an utmp entry is not written for the session.&lt;BR /&gt;&lt;BR /&gt;In theory, OpenSSH *could* invent some session-specific identifier in lieu of the PTY name and write an utmp entry using it. (I think some FTP servers do something like this.)&lt;BR /&gt;Or it could have a separate tracking system for PTYless sessions. So I would have to say this is mostly a limitation of OpenSSH.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Tue, 08 Feb 2011 11:38:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748342#M43551</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2011-02-08T11:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748343#M43552</link>
      <description>Thanks for that great explanation MK.&lt;BR /&gt;I was wondering if this had to do something with tty since scp/ftp users don't show up when you run the "w" command.&lt;BR /&gt;&lt;BR /&gt;So my logical next question would be; Does anyone know of an sftp server that allows me to enforce these PAM limits correctly or perhaps uses another method to limit the logon count per user to one?&lt;BR /&gt;&lt;BR /&gt;Or perhaps this issue was fixed in Debian 6.&lt;BR /&gt;Gives me an good excuse to have a look their latest creation. :)&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2011 12:31:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748343#M43552</guid>
      <dc:creator>wobbe</dc:creator>
      <dc:date>2011-02-08T12:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748344#M43553</link>
      <description>&lt;!--!*#--&gt;Wobbe,&lt;BR /&gt;&lt;BR /&gt;You can try modding the Secure SHell Daemon in sshd_config and tweak the below parametre:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MaxStartups&lt;BR /&gt;Specifies the maximum number of concurrent unauthenticated connections to the sshd daemon.  Additional connections will bedropped until authentication succeeds or the LoginGraceTime expires for a connection.  The default is 10.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2011 14:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748344#M43553</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-02-08T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748345#M43554</link>
      <description>Thanks for the suggestion Alzhy but I'm planning to use more than one account.</description>
      <pubDate>Tue, 08 Feb 2011 15:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748345#M43554</guid>
      <dc:creator>wobbe</dc:creator>
      <dc:date>2011-02-08T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: PAM limits won't work on SFTP or SCP</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748346#M43555</link>
      <description>Well -- check if there are other tunables in sshd_config (man sshd_config).&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2011 18:54:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pam-limits-won-t-work-on-sftp-or-scp/m-p/4748346#M43555</guid>
      <dc:creator>Alzhy</dc:creator>
      <dc:date>2011-02-08T18:54:41Z</dc:date>
    </item>
  </channel>
</rss>

