AFS Permission Denied on lxplus Login
When I logged into lxplus today, Bash greeted me with:
-bash: /afs/cern.ch/user/m/melashri/.bash_profile: Permission deniedAt first, I thought the file was missing, but the error actually meant AFS couldn’t be accessed, not that the file was gone.
Step 1 - Check what’s going on
ls -l /afs/cern.ch/user/m/melashri/.bash_profileWhich returned:
ls: cannot access '/afs/cern.ch/user/m/melashri/.bash_profile': Permission deniedI guess that is probably a classic sign that my AFS token had expired.
Step 2 - Renew Kerberos ticket and AFS token
kinit melashri@CERN.CH
aklogAfter that, everything was immediately back to normal:
ls -l /afs/cern.ch/user/m/melashri/.bash_profile
-rw-r--r--. 1 root root 193 Nov 24 2021 /afs/cern.ch/user/m/melashri/.bash_profileStep 3 - Verify and relax
Logging out and back in showed no more permission errors. It turned out to be just an expired Kerberos session, not a permissions or ownership problem. Running kinit followed by aklog is usually enough to restore access to your AFS home on lxplus.