I have a Linux server using Kerberos for user authentication, and AFS for user homes. When I log into the machine with a forwardable Kerberos ticket, (I suppose) PAM takes care of my AFS authentication too, so I automatically get access to my AFS home after login.
Let's say I log in, and I create a screen session and start an application in it. Then I detach my screen session, and log out from the machine. My Kerberos ticket gets dropped automatically, so my screen session running in the background and the application running in it doesn't have access to my AFS home anymore. This is normal, and it's good as it is.
Next time when I log into the machine, how can I "provide" my already running screen session and the application running in it (the processes themselves) with a new Kerberos ticket and make it able to access my AFS home again without having to restart it?
The "right" answer is to use something like krenew or kstart to monitor your screen session and make sure it has a valid tgt and afs token. Most sites will allow you to renew your ticket for up to 7 days.
However, that's not the question you asked. The ticket part is easy. The environmental variable KRB5CCNAME stores the location of your kerberos ticket. Generally it looks something like this
So poke around in the /proc system and find the value of KRB5CCNAME for your screen process and copy your existing ticket to that file location.
The AFS token part is much trickier, if you can get the screen process to somehow run aklog after you copy the ticket, that is the most straightforward solution.
There are tools for extracting and setting tokens. gettoken and settoken, but I know of no straightforward way to use them to set the token for an arbitrary process. AFS tokens are stored as part of the process data in the kernel. That's why you see the funny high numbered groups when you use the groups command on a machine using AFS.