LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   is my pam_time.so broken or am I using it incorrectly (to restrict http access) ? (https://www.linuxquestions.org/questions/linux-networking-3/is-my-pam_time-so-broken-or-am-i-using-it-incorrectly-to-restrict-http-access-4175451831/)

max.b 02-26-2013 07:08 PM

is my pam_time.so broken or am I using it incorrectly (to restrict http access) ?
 
I've read that PAM can be used to restrict HTTP access for some users, but I can't figure out how to do it in Ubuntu 12.04.

The `/etc/security/time.conf` man page contains this example:

Quote:

All users except for root are denied access to console-login at all times:

Code:

login ; tty* & !ttyp* ; !root ; !Al0000-2400

For this to work, `/etc/pam.d/login` needs to have a line

Code:

  account    requisite  pam_time.so
This example works, and I tried to adapt it to limit HTTP access from the console. I added
Code:

    http ; tty* & !ttyp* ; !root ; !Al0000-2400 # will fix "time" later
to `/etc/security/time.conf`, and created `/etc/pam.d/http` with

Code:

  account    requisite  pam_time.so
This doesn't work. I can still use `wget` as non-root from the console.

unSpawn 02-27-2013 01:09 PM

Quote:

Originally Posted by max.b (Post 4900483)
is my pam_time.so broken or am I using it incorrectly (to restrict http access) ?

The latter I'm afraid.


Quote:

Originally Posted by max.b (Post 4900483)
I've read that PAM can be used to restrict HTTP access for some users

Where did you read that?


Quote:

Originally Posted by max.b (Post 4900483)
I tried to adapt it to limit HTTP access from the console. (..) This doesn't work. I can still use `wget` as non-root from the console.

PAM stacks are tied to system services and applications that involve authentication, require root privileges or need other user management. There's ways to do what you want from using PAM consolehelper to combining the iptables time and owner modules to whatever-modifying cron jobs but some suggestions may not apply. Please describe in detail what you want to do and if this applies to only 'wget' or also related / equivalent tools and if it applies to a single, a group or all users.


All times are GMT -5. The time now is 05:13 AM.