https://wiki.hpc.arcs.njit.edu/index.php?title=UsingKrenew&feed=atom&action=historyUsingKrenew - Revision history2024-03-28T23:57:24ZRevision history for this page on the wikiMediaWiki 1.26.2https://wiki.hpc.arcs.njit.edu/index.php?title=UsingKrenew&diff=203&oldid=prevHpcwiki1 dept.admin: Importing text file2020-10-05T16:36:36Z<p>Importing text file</p>
<p><b>New page</b></p><div><br />
When a user logs into an AFS client, the user gets a "Kerberos ticket". The AFS token is generated from the Kerberos ticket. You can see this by <br />
logging into any AFS client and running the command 'klist.'<br />
<br />
<pre code><br />
somehost-57 user123>: klist<br />
Ticket cache: FILE:/tmp/krb5cc_98765_1Ul1SV<br />
Default principal: user123@NJIT.EDU<br />
<br />
Valid starting Expires Service principal<br />
02/27/14 11:44:23 02/27/14 19:44:24 krbtgt/NJIT.EDU@NJIT.EDU<br />
renew until 03/29/14 12:44:23<br />
02/27/14 11:44:23 02/27/14 19:44:24 afs/cad.njit.edu@NJIT.EDU<br />
renew until 03/29/14 12:44:23<br />
</pre><br />
<br />
To see the tokens :<br />
<br />
<pre code><br />
somehost-58 user123>: tokens<br />
<br />
Tokens held by the Cache Manager:<br />
<br />
User's (AFS ID 98765) tokens for afs@cad.njit.edu [Expires Feb 27 19:44]<br />
--End of list--<br />
</pre><br />
<br />
Note that in the above case, the user logged in at 11:44 the ticket and <br />
token expires eight hours later, at 19:44. Also note that the ticket is <br />
renewable until the end of March.<br />
<br />
The command to automatically renew the Kerberos ticket and AFS token is :<br />
<br />
<pre code><br />
krenew -b -t -K 60<br />
<br />
-b : run the background<br />
-t : run aklog to get the AFS token after the ticket is renewed<br />
-K 60 : check every 60 minutes and see if the ticket needs to be renewed<br />
</pre><br />
<br />
Using krenew as above is useful in circumstances such as the following:<br />
<br />
* Maintain login credentials on a personal workstation<br />
* Maintain a VNC or screen session<br />
<br />
Alternatively, krenew can take a command as an argument. In this case <br />
krenew maintains credentials specific to the command. For example, to <br />
run sftp with krenew :<br />
<br />
<pre code><br />
krenew -t -K 60 /usr/bin/sftp<br />
</pre><br />
<br />
To run a long running compute job in the background where the output is <br />
directed to a file, the argument to krenew needs to be a shell followed <br />
by the command :<br />
<br />
<pre code><br />
krenew -t -b -K 60 -- sh -c '/full/path/to/compute-job > /afs/cad/.../output.file'<br />
</pre><br />
<br />
[[Category:Running Jobs]]</div>Hpcwiki1 dept.admin