Skip to content

Commit 013b9d5

Browse files
SyntaxRulesSyntaxRules
authored andcommitted
feat(post): restricting user access via slurm
1 parent c77d7f0 commit 013b9d5

4 files changed

Lines changed: 75 additions & 49 deletions

File tree

_drafts/redfish-vs-ipmi.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
https://robhirschfeld.com/2014/12/11/redfish-ipmi-bios/
2+
3+
https://www.packet.net/blog/redfish-and-the-future-of-bare-metal-server-automation/
4+
5+
Great summary of the need for redfish and an overview of it advantages, specificly for scripting.
6+
7+
https://www.dmtf.org/standards/redfish
8+
9+
DMTF - Distributed Management Task Force, created redfish as a replacement to IPMI. IPMI spec references DMTF and uses their RCMP protocol. DMTF no longer talks about the RMCP protocol.
10+
11+
12+
13+
Make a ipmi to redfish translator so those using a mixed variety can upgrade.
14+
15+
How about making a mock redfish implementation. That way developers can test scripts on it!
16+
17+
http://redfish.dmtf.org/redfish/v1/mockup/767
18+
19+
Redfish mockup

_drafts/restrict-user-access-in-slurm.md

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: post
3+
title: "Restricting User Access via SLURM"
4+
tags: hpc software slurm
5+
---
6+
Making it so users can only ssh into the nodes they have reserved is built into SLURM. I had a hard time finding all the steps in one place, here's what I did.
7+
8+
Using centos 7.x you'll need to edit two files (both in the compute node image a.k.a vnfs):
9+
1. $CHROOT/etc/pam.d/password-auth
10+
2. $CHROOT/etc/security/access.conf
11+
12+
Where $CHROOT is the location to your image. Edit the files like so:
13+
14+
Edit $CHROOT/etc/pam.d/password-auth:
15+
```
16+
account required pam_unix.so
17+
account required pam_slurm.so # Add this line, below pam_unix.so, but above everything else
18+
account sufficient pam_localuser.so
19+
account sufficient pam_succeed_if.so uid < 500 quiet
20+
account required pam_permit.so
21+
```
22+
23+
Edit $CHROOT/etc/security/access.conf:
24+
```
25+
# All other users should be denied to get access from all sources.
26+
+ : root : ALL # Uncomment or add this line at the bottom of the file
27+
- : ALL : ALL # Uncomment or add this line at the bottom of the file
28+
```
29+
30+
Now rebuild and apply your image/vnfs to the nodes. (Not covered here.)
31+
32+
Test it out:
33+
```
34+
[sr@sms ~]$ ssh compute-1
35+
Access denied: user sr (uid=1) has no active jobs on this node.
36+
Connection closed by 192.168.x.x
37+
[sr@sms ~]$ salloc -n 1
38+
salloc: Granted job allocation 71
39+
[sr@sms ~]$ squeue
40+
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
41+
71 shared bash sr R 0:04 1 compute-1
42+
[sr@sms ~]$ ssh compute-1
43+
[sr@compute-1 ~]$ # Note we can log in now!
44+
[sr@compute-1 ~]$ exit
45+
logout
46+
Connection to knl-36 closed.
47+
[sr@sms ~]$ scancel 71
48+
salloc: Job allocation 71 has been revoked.
49+
```
50+
51+
## References:
52+
53+
[How to set resource limits within SLURM](https://slurm.schedmd.com/faq.html#pam)
54+
55+
[Using PAM to secure userspace with SLURM](https://groups.google.com/forum/#!topic/slurm-devel/sVkZ1FFVq5s)

_posts/2017-2-6-play-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For my purposes, here's what I need:
1818

1919
So where do you start? How to find that perfect, cheap, server? I started my search on google, and quickly found [Server Monkey](http://www.servermonkey.com/), a seller of refurbished servers. This is a great way to get a cheap, garenteed to work server. You can get a pretty decient setup there for about $100.
2020

21-
However, you can go even cheaper. Look through Server Monkey, find what they sell for cheap, then head over to [Ebay](www.ebay.com). You'll often find various configurations of these servers on e-bay for (sometimes) a fraction of the cost.
21+
However, you can go even cheaper. Look through Server Monkey, find what they sell for cheap, then head over to [Ebay](http://www.ebay.com). You'll often find various configurations of these servers on e-bay for (sometimes) a fraction of the cost.
2222

2323
## What I got, what I paid
2424

0 commit comments

Comments
 (0)