kerberos update
This commit is contained in:
parent
8ffd1b6019
commit
6050d62c96
@ -120,7 +120,7 @@ export KRB5CCNAME="$(mktemp "$HOME/.k5/krb5cc_XXXXXX")"
|
|||||||
# Example two: Independent Kerberos5 cache
|
# Example two: Independent Kerberos5 cache
|
||||||
# ${SLURM_JOBID} will make the cache independent per job
|
# ${SLURM_JOBID} will make the cache independent per job
|
||||||
# Use it only if necessary
|
# Use it only if necessary
|
||||||
export KRB5CCNAME="$(mktemp "$HOME/.k5/krb5cc_${SLURM_JOBID}")"
|
export KRB5CCNAME="$(mktemp "$HOME/.k5/krb5cc_XXXXXX-{SLURM_JOBID}")"
|
||||||
```
|
```
|
||||||
* To obtain a Kerberos5 granting ticket, run `kinit` by using your keytab:
|
* To obtain a Kerberos5 granting ticket, run `kinit` by using your keytab:
|
||||||
```bash
|
```bash
|
||||||
@ -133,6 +133,8 @@ aklog
|
|||||||
|
|
||||||
### Slurm batch script example: obtaining KRB+AFS granting tickets
|
### Slurm batch script example: obtaining KRB+AFS granting tickets
|
||||||
|
|
||||||
|
* Example 1 (**recommended**, shared cache file):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#SBATCH --partition=hourly # Specify 'general' or 'daily' or 'hourly'
|
#SBATCH --partition=hourly # Specify 'general' or 'daily' or 'hourly'
|
||||||
@ -152,4 +154,34 @@ aklog
|
|||||||
klist
|
klist
|
||||||
|
|
||||||
echo "Here should go my batch script code."
|
echo "Here should go my batch script code."
|
||||||
|
``
|
||||||
|
|
||||||
|
* Example 2 (independent cache file):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
#SBATCH --partition=hourly # Specify 'general' or 'daily' or 'hourly'
|
||||||
|
#SBATCH --time=01:00:00 # Strictly recommended when using 'general' partition.
|
||||||
|
#SBATCH --output=run.out # Generate custom output file
|
||||||
|
#SBATCH --error=run.err # Generate custom error file
|
||||||
|
#SBATCH --nodes=1 # Uncomment and specify #nodes to use
|
||||||
|
#SBATCH --ntasks=1 # Uncomment and specify #nodes to use
|
||||||
|
#SBATCH --cpus-per-task=1
|
||||||
|
#SBATCH --constraint=xeon-gold-6152
|
||||||
|
#SBATCH --hint=nomultithread
|
||||||
|
#SBATCH --job-name=krb5
|
||||||
|
|
||||||
|
export KRB5CCNAME="$(mktemp "$HOME/.k5/krb5cc_XXXXXX-${SLURM_JOBID}")"
|
||||||
|
kinit -kt "$HOME/.k5/krb5.keytab" $USER@D.PSI.CH
|
||||||
|
aklog
|
||||||
|
klist
|
||||||
|
|
||||||
|
echo "Here should go my batch script code."
|
||||||
|
|
||||||
|
# Destroy Kerberos tickets created for this job only
|
||||||
|
kdestroy
|
||||||
|
klist
|
||||||
|
|
||||||
|
# Remove the remaining cache file
|
||||||
|
rm -f $KRB5CCNAME
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user