Project

General

Profile

AFS Client Installation » History » Version 1

Joseph Foley, 2015-09-05 02:44

1 1 Joseph Foley
{{toc}}
2
3
h1. AFS Client Installation
4
5
Originally at the DevNet project pages.
6
A very nice guide can be found at Cornell https://confluence.cornell.edu/display/CNF/Installing+AFS
7
8
h1. Windows
9
10
Some good instructions at http://claymore.rfmh.org/public/computer_resources/winAFSclientinstall.html
11
12
# Install the Kerberos for Windows 3.2.2
13
## *IMPORTANT: Do NOT install version 4.X.  It does not work with AFS*
14
## *IMPORTANT: If you install the 64 bit version, you will also need to install the 32 bit tools*
15
## http://www.secure-endpoints.com/netidmgr/roadmap.html
16
# Install the latest version of Network Identity Manager
17
## https://www.secure-endpoints.com/netidmgr/v2/#download
18
## When asked, the kerberos realm is @CS.RU.IS@ *Note the uppercase letters*
19
## If you are not a RU student or staff, then your realm will be @RND.RU.IS@
20
# Download the latest OpenAFS version, preferably 1.7 or higherD
21
## *IMPORTANT: If you install the 64 bit version, you will also need to install the 32 bit tools*
22
## http://www.openafs.org/windows.html
23
## The AFS realm is @rnd.ru.is@  *Note the lowercase letters and that it is NOT cs.ru.is*
24
# Then reboot the computer
25
# You will notice after rebooting a new context menu "AFS" when you right click anywhere.  This is how you will interact with AFS to get information and change access control.
26
# You will need to get Kerberos Tickets from the "Network Identity Manager".  This will also show up in the little icons in the bottom right.  If you can't find it, you can also run it from the start menu
27
## You need to create a new credential.  Replace "username" in these instructions with your username
28
## Menubar Credential > New Credentials > Obtain new credentials...
29
## Click on the top bar where it says Kerberos Principal > New Identity
30
## Username:  (whatever your username was) and click "Next >"
31
## Realm: CS.RU.IS "Next >"
32
## Keep the default options. click "Next >"  
33
## Make sure "Obtain AFS credentials" is clicked.  The Cell should be "rnd.ru.is".  Note that this must be in lowercase and different than your kerberos realm.  Click on "Add/Update" then "Next >"
34
## If you are presented with Kerberos 4 options, disable them.  Click "Next >"
35
## You should now type in your password and "Finish"
36
### You will have to get new credentials and type in your password every 8 hours.
37
## If all goes well, you will see that the username@CS.RU.IS entry will say you have "Kerberos v5 tickets (s) AFS tokens (1)"
38
# To find AFS, goto the "Network" in an explorer window.  There should be an AFS entry.  
39
## Double click on it, then double click on "rnd.ru.is"
40
41
h1. Linux 
42
43
After you have followed the directions below, if you have local users, you will need to adjust the minimum UID in the pam settings or it won't let you change the password.  In debian, look under @/etc/pam.d/common-password@
44
<pre>
45
password        [success=2 default=ignore]      pam_krb5.so minimum_uid=2000
46
</pre>
47
Make sure that all of your local (non-kerberos) users have a UID that is lower than the minimum_uid.
48
49
h2. Raspberry Pi (Debian)
50
51
These instructions are not completely tested.
52
You will need at least a 4GB card to download all the necessary software and linux kernel
53
54
Much of this is taken from http://www.raspberrypi.org/phpBB3/viewtopic.php?f=71&t=17666
55
56
Other guides:
57
* rpi-update https://github.com/Hexxeh/rpi-update/
58
59
# Install the latest dist and necessary tools
60
<pre>sudo bash
61
apt-get update
62
apt-get -y dist-upgrade
63
apt-get -y install gcc make git build-essential dkms
64
</pre>
65
# Install rpi-update and grab the latest firmware
66
<pre>
67
cd rpi-update
68
apt-get install ca-certificates
69
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
70
</pre>
71
# Grab latest kernel
72
<pre>cd /usr/src
73
wget  https://github.com/raspberrypi/linux/tarball/rpi-3.2.27 -O rpi-3.2.27.tgz
74
tar xzf rpi-3.2.27.tgz
75
</pre>
76
# Grab the configs from the kernel
77
<pre>cd raspberrypi-linux-*
78
zcat /proc/config.gz > .config
79
make oldconfig
80
make modules_prepare
81
</pre>
82
# Get the 
83
<pre>wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers</pre>
84
# Make symlinks for the build system
85
<pre>KSRC=`pwd`
86
pushd /lib/modules/`uname -r`
87
ln -s ${KSRC} source
88
ln -s ${KSRC} build
89
popd
90
91
pushd /usr/src
92
ln -s ${KSRC} linux-`uname -r`
93
ln -s ${KSRC} linux
94
popd</pre>
95
# Install kerberos packages
96
<pre>apt-get install krb5-auth-dialog krb5-user krb5-clients libpam-ccreds libpam-krb5</pre>
97
# Install the afs client and related modules
98
<pre>apt-get install  openafs-modules-dkms openafs-{client,krb5}</pre> 
99
## if it doesn't go successfuly, you can re-run it with:
100
<pre>dpkg-reconfigure openafs-modules-dkms</pre>
101
102
h2. Debian/Ubuntu
103
104
Note!  AFS and Keberos will mostly autoconfig on the client side unless RU's DNS is broken.  It is very important that you never let the disk that has the AFS cache fill up.  If that happens, bad things may occur.  See directions about how to setup a fixed cache if you are concerned about this.  In some installations, people put the cache in a separate partition to eliminate the risk.
105
106
h3. Kerberos Client
107
108
* see e.g., Spinlock Guide on Kerberos http://techpubs.spinlocksolutions.com/dklar/kerberos.html
109
110
# Install packages for Kerberos and AFS
111
<pre>sudo apt-get install krb5-auth-dialog krb5-user libpam-ccreds libpam-krb5 build-essential dkms linux-headers-`uname -r` libpam-afs-session openafs-modules-dkms openafs-{client,krb5}</pre>
112
# The kerberos config will ask you questions, you should answer:
113
** realm: @RND.RU.IS@
114
** Kerberos server: @kerberos.rnd.ru.is@
115
** Kerberos administrative server: @kerberos.rnd.ru.is@
116
** If you need to fix this later, run @dpkg-reconfigure krb5-config@
117
# Check DNS and hostnames
118
* Make sure that the hostname is not listed in @/etc/hosts@
119
* Make sure that the @hostname@ command returns the full hostname e.g. gryla.rnd.ru.is
120
# Edit the @/etc/krb5.conf@
121
** search for @[domain_realm]@ and add these lines after
122
<pre>
123
.rnd.ru.is = RND.RU.IS
124
rnd.ru.is = RND.RU.IS
125
</pre>
126
** After @[libdefaults]@ add
127
<pre> allow_weak_crypto = true </pre>
128
# if you do not have a Kerberos user name: ask Joe (foley@ru.is) or Stephan (stephans@ru.is) to give you one
129
# check if it works <pre>
130
$ kinit YOUR_KERBEROS_USERNAME
131
Password for YOUR_KERBEROS_USERNAME@RND.RU.IS:
132
$ klist
133
Ticket cache: FILE:/tmp/krb5cc_1000
134
Default principal: YOUR_KERBEROS_USERNAME@RND.RU.IS
135
136
Valid starting     Expires            Service principal
137
03/30/12 13:53:15  03/30/12 23:53:15  krbtgt/RND.RU.IS@RND.RU.IS
138
        renew until 03/31/12 13:53:11
139
</pre>
140
# if the Kerberos principal and the local username differ
141
** create the file @~/.k5login@ with the content <pre>MYPRINCIPAL@RND.RU.IS</pre>
142
** instruct pam-krb5 to read your principal from @~/.k5login@ by adding the following to @/etc/krb5.conf@:
143
<pre>
144
[appdefaults]
145
        pam = {
146
                search_k5login = true
147
        }
148
</pre>
149
150
Now use the Kerberos principal's password when asked for a password on login at your computer and you should automatically get a Kerberos ticket (check with @klist@ after login). If not connected to the Internet, the local password is active/requested again.
151
152
h3. AFS Client
153
154
# Install packages
155
<pre>sudo apt-get 
156
</pre> 
157
## Cell: @rnd.ru.is@
158
## Cache: @500000@ (choose depending on your hard disk space, more cache = less network traffic)
159
# Now setup the cache so it can never overfill (very bad things happen).  If you have already setup a partition for the cache then this step is unnecessary.
160
<pre>
161
cd /var/cache
162
sudo dd if=/rnd/zero of=openafs-cache.img bs=10M count=55   # (~550 MB partition)
163
sudo mkfs.ext4 openafs-cache.img
164
sudo sh -c "echo '/var/cache/openafs-cache.img /var/cache/openafs ext4 defaults,loop 0 2' >> /etc/fstab"
165
sudo tune2fs -c 0 -i 0 -m 0 openafs-cache.img
166
</pre>
167
# test by mounting the cache
168
<pre>sudo mount /var/cache/openafs</pre>
169
# Add entries to @/etc/openafs/CellServDB@
170
## Note that the AFS cell *MUST* be lowercase
171
<pre>>rnd.ru.is         # Reykjavik University Research and Development Network
172
130.208.242.66          #afsdb1.rnd.ru.is
173
130.208.242.67		#afsdb2.rnd.ru.is
174
130.208.242.68          #afsdb3.rnd.ru.is  
175
</pre>
176
# enable the AFS client (not always needed)
177
<pre>sudo perl -pi -e's/AFS_CLIENT=false/AFS_CLIENT=true/' /etc/openafs/afs.conf.client</pre>
178
# (re-)start the client
179
<pre>sudo invoke-rc.d openafs-client restart</pre>
180
# Get AFS tokens upon login (from pam-afs)
181
## Note that this will only automatically get tokens if you add this line in @/etc/pam.d/common-session@ after the @pam_krb5.so@ line
182
<pre>session required                        pam_afs_session.so program=/usr/bin/aklog</pre>
183
# have fun at @/afs/rnd.ru.is/@
184
# If you want to make it a little simpler, do a symlink from /afs/rnd.ru.is/<.,..>/<username> to /home/username
185
# then you don't have to change /etc/password to start using the homedirectory!
186
# To automatically get Kerberos tickets and AFStokens, grab this auth-client-config file http://afs.rnd.ru.is/project/rndnet/Public/Workstation/etc/auth-client-config/profile.d/rndnet and put it into @/etc/auth-client-config@.  You can also grab them via afs:
187
<pre>cp /afs/rnd.ru.is/project/rndnet/Public/Workstation/etc/auth-client-config/profile.d/rndnet /etc/auth-client-config/profile.d/.</pre>
188
# Then run it to set your machine to configure PAM and NSS for kerberos/afs
189
<pre>sudo auth-client-config -a -p rndnet_workstation</pre>
190
191
h3. Debian 7 on a KVM/Proxmox VM
192
193
The VMs need a fix for a module compile problem with struct dentry, which is fixed in openafs 1.6.11, which is sadly not in the stable distribution.
194
195
After you follow the main debian instructions, you need to:
196
197
# Switch to sid (unstable
198
<pre>zile /etc/apt/sources.list
199
#replace wheezy with sid
200
</pre>
201
# select 1.6.11
202
<pre>apt-get update; apt-get install openafs-modules-dkms=1.6.11.1-1</pre>
203
# Now the kernel module will build properly.
204
205
h2. Redhat Varients
206
207
h3. Fedora
208
209
Openafs has binary builds for up to Fedora 20.  Follow the centos instructions.
210
211
For Fedora 21 (or others) you will need to do a source build.  Get the src.rpm and follow these instructions on the wiki
212
http://wiki.openafs.org/HowToBuildOpenAFSFromSource/
213
Alternatively use the copr packages from jsbillings
214
* https://copr.fedoraproject.org/coprs/jsbillings/openafs/
215
* https://copr.fedoraproject.org/coprs/jsbillings/openafs-kmod/
216
217
Let's get started
218
219
* Grab the appropriate .repo files and put them into /etc/yum.repos.d
220
* Update yum
221
<pre>yum -y update</pre>
222
* Prerequisites and the packages
223
<pre>
224
yum install git-core gcc autoconf automake libtool make flex bison glibc-devel krb5-devel perl-devel ncurses-devel pam-devel kernel-devel-$(uname -r) wget perl-devel perl-ExtUtils-Embed rpm-build krb5-libs krb5-workstation dkms rpmbuild kernel-headers dkms openafs-client openafs-krb5 dkms-openafs
225
</pre>
226
* Make sure that the /var/cache/openafs got labeled for selinux
227
<pre>restorecond -r -v /var/cache/openafs</pre>
228
* Sometimes dkms does not run for newer kernels, check in /var/lib/dkms/openafs.  Check which version e.g. 1.6.11-1.fc21 if you need to force it
229
<pre>dkms --verbose install -m openafs -v 1.6.11-1.fc21</pre>
230
* Start it up!
231
<pre>service openafs-client start</pre>
232
* Update your /etc/krb5.conf.  The stock version is missing a lot of entries.
233
234
h3. Centos
235
236
From http://docs.openafs.org/QuickStartUnix/ch02s09.html
237
238
* Install EPAL repos
239
** i386 (32 bit) <pre>rpm -U http://www.fedora.is/epel/6/i386/epel-release-6-8.noarch.rpm</pre>
240
** 64(bit) <pre>rpm -U http://www.fedora.is/epel/6/x86_64/epel-release-6-8.noarch.rpm</pre>
241
* Grab the openafs repositories file 
242
<pre>wget http://dl.openafs.org/dl/openafs/1.6.6/openafs-repository-rhel-1.6.1-5.noarch.rpm</pre>
243
* Install the source repositories
244
<pre>rpm -U openafs-repository*.rpm</pre>
245
* Make sure that the source repositories are enabled in @/etc/yum.repos.d@.
246
* Edit @/etc/yum.conf.d/openafs-rhel.repo@
247
** change $basearch to $arch in <pre>baseurl=http://dl.openafs.org/dl/openafs/1.6.6/rhel$releasever/$arch/</pre>
248
** set <pre>gpgcheck=0</pre>  because the rpms are currently not signed
249
* Install kerberos
250
<pre>sudo yum -y install krb5-libs krb5-workstation
251
</pre>
252
* Install rndelopment packages
253
<pre>sudo yum -y groupinstall "Rndelopment Tools"</pre>
254
* Install the packages
255
<pre>sudo yum -y install kernel-headers kernel-rndel-`uname -r` dkms openafs-client openafs-krb5 dkms-openafs</pre>
256
* Now go edit @/etc/krb5.conf@
257
<pre>[libdefaults]
258
 default_realm = RND.RU.IS
259
 dns_lookup_realm = true
260
 dns_lookup_kdc = true
261
 allow_weak_crypto = true
262
</pre>
263
* Edit @/etc/ntp.conf@ and set time.rnd.ru.is as the server
264
* Restart ntpd
265
<pre>sudo service ntpd restart</pre>
266
* Edit @/etc/vice/etc/ThisCell@ and put rnd.ru.is in it
267
* Start the services
268
<pre>sudo service openafs-client start</pre>
269
270
271
h1. OSX
272
273
Guides:
274
* General guide http://www.spy-hill.com/~myers/help/apple/OpenAFS.html
275
* Server and tool guide http://workshop.openafs.org/afsbpw06/talks/kula-afsbpw06.pdf
276
277
h3. Install
278
279
# Install the client at http://openafs.org/macos.html
280
# Install the MIT Kerberos extras http://web.mit.edu/macdev/www/osx-kerberos-extras.html
281
# Reboot
282
283
h3. Where is the @krb5.conf@?
284
285
From: http://support.apple.com/kb/TS3265
286
287
Kerberos looks for configuration options in these locations (in this order):
288
# ODbundle (magic DNS)
289
# @~/Library/Preferences/edu.mit.Kerberos@
290
# @/Library/Preferences/edu.mit.Kerberos@
291
# @/etc/krb5.conf@
292
293
If you have not installed the MIT Kerberos extras, the files will not exist.
294
295
h2. Testing
296
297
# Notice the lock icon on the top of the Finder window that allows you to start and stop AFS
298
# To get tickets, you need to open a terminal
299
## Use Spotlight and type "Terminal" or goto Applications > Utilities > Terminal
300
# Use @kinit@ to get tickets.  Replace @user@ with your username
301
## <pre>kinit user@RND.RU.IS</pre>
302
# Use @aklog@ to get AFS tokens
303
## <pre>aklog rnd.ru.is</pre>
304
305
h2. Useful stuff
306
307
The AFS tools are in  @/Library/OpenAFS/Tools/bin/@  You may want to make a symlink to /usr/bin so that you don't have to type the name in all the time
308
<pre>sudo ln -s /Library/OpenAFS/Tools/bin/* /usr/bin/.</pre>
309
310
h1. Common
311
312
At some point in the install, you will may need to adjust the kerberos configuration file.  In the those instructions, you will be referred back to here.  You don't need to do so until instructed.
313
314
On windows systems, this file is @c:\Windows\krb5.ini@.  On OSX and Linux, it is @/etc/krb5.conf@.  See the OSX instructions for alternatives.
315
You can grab a copy at http://afs.rnd.ru.is/project/rndnet/Public/Workstation/etc/krb5.conf
316
Make sure it contains these lines.  There will be more entries in the file, don't delete them. Also, don't copy the ... lines
317
<pre>
318
[libdefaults]
319
default_realm = RND.RU.IS
320
dns_lookup_realm = true
321
dns_lookup_kdc = true
322
# The following krb5.conf variables are only for MIT Kerberos.
323
        krb4_config = /etc/krb.conf
324
        krb4_realms = /etc/krb.realms
325
        kdc_timesync = 1
326
#       ccache_type = 4
327
        forwardable = true
328
        proxiable = true
329
# need this for AFS and MIT
330
        allow_weak_crypto = yes
331
332
#... other stuff ...
333
334
[realms]
335
	RND.RU.IS = {
336
		kdc = kerberos.rnd.ru.is
337
		kdc = kerberos-1.rnd.ru.is
338
		kdc = kerberos-2.rnd.ru.is                
339
		admin_server = kerberos.rnd.ru.is
340
                default_domain = rnd.ru.is
341
	}
342
        CS.RU.IS = {
343
                kdc = ipa.cs.ru.is
344
                admin_server = ipa.cs.ru.is
345
                default_domain = cs.ru.is
346
        }
347
#... more stuff ...
348
349
[domain_realm]
350
        .cs.ru.is = CS.RU.IS
351
        cs.ru.is = CS.RU.IS
352
        .rnd.ru.is = RND.RU.IS
353
        rnd.ru.is = RND.RU.IS
354
355
#... more stuff ...
356
</pre>
357
358
359
h3. Debugging problems in windows
360
361
http://webchat.freenode.net and connect to channel #openafs
362
363
If you need to adjust the Kerberos or CellSrvDB settings.  This is *optional* and only necessary if you can't see the AFS folders after the above directions.
364
* Remember that you need to right-click on your editor first and "Run as administrator" *DO NOT OPEN IN NOTEPAD!  IT WILL MANGLE THE FILE!!!!*
365
* CellServDB is in @c:\Program Files\OpenAFS\Client@
366
<pre>>rnd.ru.is         # Reykjavik University Research and Development Network
367
130.208.242.66          #afsdb1.rnd.ru.is
368
130.208.242.67		#afsdb2.rnd.ru.is
369
130.208.242.68          #afsdb3.rnd.ru.is  
370
</pre>
371
* Now edit @c:\Windows\krb5.ini@.  You shouldn't need to do this if DNS is working right.  Refer to the [[AFS_Client_Installation#Common|Test]] section above for what should go into that file.
372
373
374
Tools:
375
376
* http://technet.microsoft.com/en-us/sysinternals/bb896653
377
* http://technet.microsoft.com/en-us/sysinternals/bb896655
378
379
380
h1. Frequently Asked Questions (FAQ)
381
382
Lots of issues and suggestions here:
383
* http://docs.oracle.com/cd/E19253-01/816-4557/trouble-6/index.html
384
* http://www.ncsa.illinois.edu/UserInfo/Resources/Software/kerberos/troubleshooting.html
385
386
A good place to get help is the #openafs channel at freenode IRC:  https://webchat.freenode.net/
387
388
h2. How do I calculate the maximum cache size?
389
390
See this page:  https://wiki.mageia.org/en/Installing_OpenAFS_Client#Check_correct_cache_size_is_defined
391
392
h2. AFS's module loaded but there is nothing in /afs.  What went wrong?
393
394
You might have a cache size issue or something else stopping the client.
395
Check the logs.  On a systemd/journald system <pre>systemctl status openafs-client</pre>
396
397
h2. I can see the AFS cell, but I can't access my files in my home directory/folder
398
399
This probably means you are not getting tokens.  make sure you see "AFS tokens(1)" next to your name on the Network Identity Manager.
400
If you don't:
401
402
# Menubar: Options > Identities
403
# Click on the username@RND.RU.IS entry
404
# Select the AFS tab
405
# Make sure "rnd.ru.is" is listed in the table.  Make sure that "openafs.org" is not listed.  You can use the "Add/Update" and "Delete" buttons to adjust the list.
406
# Click "Apply"
407
408
Another possibility is that AFS has old data in that particular folder.  This is where the "flush" commands can be useful.  Try these things in this order (it may start working after any of them)
409
410
# Click on the folder, then right-click AFS > Volume/Partition > Refresh name/ID map
411
# Click on the folder, then right-click AFS > Flush File/Dir
412
# Click on the folder, then right-click AFS > Flush Volume
413
# If that doesn't work, restart AFS through the Control Panel or rebooting
414
415
416
h2. "kinit: KDC has no support for encryption type while getting initial credentials"
417
418
This means you need to manually enable weak encryption.  This is needed by AFs in order to get an authentication token.  Older Kerberos servers only use the old encryption types.  Information at https://bugzilla.redhat.com/show_bug.cgi?id=573968
419
420
Solution:  Enable weak crypto
421
# Edit @/etc/krb5.conf@ (or equivalent) 
422
## Add @allow_weak_crypto = yes@ on the @[libdefaults]@ section
423
424
h2. While upgrading Kerberos, you get the need to restart the Kerberos Cache RPC SErver
425
426
Solution: Find the Process ID and kill it on the terminal
427
# Start Menu > Run > @taskkill /F /PID@ PID-number
428
429
h2. AFS appears to be running (windows) but no \\AFS directory
430
431
Oh boy, there are many things that can be wrong here.  First run a virus checker to look for rootkits.
432
433
A problem that we discovered was if the TEMP registry entries are set to a non-absolute path.  (e.g. c:\temp is good foo\bar\temp is bad)
434
435
# open a cmd.exe as administrator
436
# regedit.exe
437
# goto HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
438
# Change the TMP and TEMP entries to a valid path that everyone can access, particularly SYSTEM
439
# Make sure that these (and windir) are all type REG_EXPAND_SZ
440
h1. Reference
441
442
* Ubuntu Serverguide to Kerberos https://help.ubuntu.com/12.04/serverguide/kerberos.html
443
444
h2. Kerberos complains about a generic error and seeing e-text
445
446
Not sure what causes this.  Some google searching implies problems with the directory lookup.  Simplest solution is to just delete the user and re-create