Project

General

Profile

AFS Client Installation » History » Version 3

Joseph Foley, 2015-11-13 23:25
mageia link

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 3 Joseph Foley
Mageia: https://wiki.mageia.org/en/Installing_OpenAFS_Client
208
209 1 Joseph Foley
h3. Fedora
210
211
Openafs has binary builds for up to Fedora 20.  Follow the centos instructions.
212
213
For Fedora 21 (or others) you will need to do a source build.  Get the src.rpm and follow these instructions on the wiki
214
http://wiki.openafs.org/HowToBuildOpenAFSFromSource/
215
Alternatively use the copr packages from jsbillings
216
* https://copr.fedoraproject.org/coprs/jsbillings/openafs/
217
* https://copr.fedoraproject.org/coprs/jsbillings/openafs-kmod/
218 2 Joseph Foley
Generally this is a better idea
219 1 Joseph Foley
220
Let's get started
221
222
* Grab the appropriate .repo files and put them into /etc/yum.repos.d
223
* Update yum
224
<pre>yum -y update</pre>
225
* Prerequisites and the packages
226
<pre>
227
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
228
</pre>
229
* Make sure that the /var/cache/openafs got labeled for selinux
230
<pre>restorecond -r -v /var/cache/openafs</pre>
231
* 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
232
<pre>dkms --verbose install -m openafs -v 1.6.11-1.fc21</pre>
233
* Start it up!
234
<pre>service openafs-client start</pre>
235
* Update your /etc/krb5.conf.  The stock version is missing a lot of entries.
236 2 Joseph Foley
237
If you have problems, it is most likely that the cache is the wrong size.
238
239
Another problem is if DKMS refuses to build because you don't have the latest kernel-dev installed or an older kernel build in the way
240
<pre>
241
dnf -y install kernel-devel-$(uname -r) --allowerasing
242
dnf reinstall dkms-openafs
243
</pre>
244 1 Joseph Foley
245
h3. Centos
246
247
From http://docs.openafs.org/QuickStartUnix/ch02s09.html
248
249
* Install EPAL repos
250
** i386 (32 bit) <pre>rpm -U http://www.fedora.is/epel/6/i386/epel-release-6-8.noarch.rpm</pre>
251
** 64(bit) <pre>rpm -U http://www.fedora.is/epel/6/x86_64/epel-release-6-8.noarch.rpm</pre>
252
* Grab the openafs repositories file 
253
<pre>wget http://dl.openafs.org/dl/openafs/1.6.6/openafs-repository-rhel-1.6.1-5.noarch.rpm</pre>
254
* Install the source repositories
255
<pre>rpm -U openafs-repository*.rpm</pre>
256
* Make sure that the source repositories are enabled in @/etc/yum.repos.d@.
257
* Edit @/etc/yum.conf.d/openafs-rhel.repo@
258
** change $basearch to $arch in <pre>baseurl=http://dl.openafs.org/dl/openafs/1.6.6/rhel$releasever/$arch/</pre>
259
** set <pre>gpgcheck=0</pre>  because the rpms are currently not signed
260
* Install kerberos
261
<pre>sudo yum -y install krb5-libs krb5-workstation
262
</pre>
263
* Install rndelopment packages
264
<pre>sudo yum -y groupinstall "Rndelopment Tools"</pre>
265
* Install the packages
266
<pre>sudo yum -y install kernel-headers kernel-rndel-`uname -r` dkms openafs-client openafs-krb5 dkms-openafs</pre>
267
* Now go edit @/etc/krb5.conf@
268
<pre>[libdefaults]
269
 default_realm = RND.RU.IS
270
 dns_lookup_realm = true
271
 dns_lookup_kdc = true
272
 allow_weak_crypto = true
273
</pre>
274
* Edit @/etc/ntp.conf@ and set time.rnd.ru.is as the server
275
* Restart ntpd
276
<pre>sudo service ntpd restart</pre>
277
* Edit @/etc/vice/etc/ThisCell@ and put rnd.ru.is in it
278
* Start the services
279
<pre>sudo service openafs-client start</pre>
280
281
h1. OSX
282
283
Guides:
284
* General guide http://www.spy-hill.com/~myers/help/apple/OpenAFS.html
285
* Server and tool guide http://workshop.openafs.org/afsbpw06/talks/kula-afsbpw06.pdf
286
287
h3. Install
288
289
# Install the client at http://openafs.org/macos.html
290
# Install the MIT Kerberos extras http://web.mit.edu/macdev/www/osx-kerberos-extras.html
291
# Reboot
292
293
h3. Where is the @krb5.conf@?
294
295
From: http://support.apple.com/kb/TS3265
296
297
Kerberos looks for configuration options in these locations (in this order):
298
# ODbundle (magic DNS)
299
# @~/Library/Preferences/edu.mit.Kerberos@
300
# @/Library/Preferences/edu.mit.Kerberos@
301
# @/etc/krb5.conf@
302
303
If you have not installed the MIT Kerberos extras, the files will not exist.
304
305
h2. Testing
306
307
# Notice the lock icon on the top of the Finder window that allows you to start and stop AFS
308
# To get tickets, you need to open a terminal
309
## Use Spotlight and type "Terminal" or goto Applications > Utilities > Terminal
310
# Use @kinit@ to get tickets.  Replace @user@ with your username
311
## <pre>kinit user@RND.RU.IS</pre>
312
# Use @aklog@ to get AFS tokens
313
## <pre>aklog rnd.ru.is</pre>
314
315
h2. Useful stuff
316
317
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
318
<pre>sudo ln -s /Library/OpenAFS/Tools/bin/* /usr/bin/.</pre>
319
320
h1. Common
321
322
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.
323
324
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.
325
You can grab a copy at http://afs.rnd.ru.is/project/rndnet/Public/Workstation/etc/krb5.conf
326
Make sure it contains these lines.  There will be more entries in the file, don't delete them. Also, don't copy the ... lines
327
<pre>
328
[libdefaults]
329
default_realm = RND.RU.IS
330
dns_lookup_realm = true
331
dns_lookup_kdc = true
332
# The following krb5.conf variables are only for MIT Kerberos.
333
        krb4_config = /etc/krb.conf
334
        krb4_realms = /etc/krb.realms
335
        kdc_timesync = 1
336
#       ccache_type = 4
337
        forwardable = true
338
        proxiable = true
339
# need this for AFS and MIT
340
        allow_weak_crypto = yes
341
342
#... other stuff ...
343
344
[realms]
345
	RND.RU.IS = {
346
		kdc = kerberos.rnd.ru.is
347
		kdc = kerberos-1.rnd.ru.is
348
		kdc = kerberos-2.rnd.ru.is                
349
		admin_server = kerberos.rnd.ru.is
350
                default_domain = rnd.ru.is
351
	}
352
        CS.RU.IS = {
353
                kdc = ipa.cs.ru.is
354
                admin_server = ipa.cs.ru.is
355
                default_domain = cs.ru.is
356
        }
357
#... more stuff ...
358
359
[domain_realm]
360
        .cs.ru.is = CS.RU.IS
361
        cs.ru.is = CS.RU.IS
362
        .rnd.ru.is = RND.RU.IS
363
        rnd.ru.is = RND.RU.IS
364
365
#... more stuff ...
366
</pre>
367
368
369
h3. Debugging problems in windows
370
371
http://webchat.freenode.net and connect to channel #openafs
372
373
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.
374
* 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!!!!*
375
* CellServDB is in @c:\Program Files\OpenAFS\Client@
376
<pre>>rnd.ru.is         # Reykjavik University Research and Development Network
377
130.208.242.66          #afsdb1.rnd.ru.is
378
130.208.242.67		#afsdb2.rnd.ru.is
379
130.208.242.68          #afsdb3.rnd.ru.is  
380
</pre>
381
* 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.
382
383
384
Tools:
385
386
* http://technet.microsoft.com/en-us/sysinternals/bb896653
387
* http://technet.microsoft.com/en-us/sysinternals/bb896655
388
389
390
h1. Frequently Asked Questions (FAQ)
391
392
Lots of issues and suggestions here:
393
* http://docs.oracle.com/cd/E19253-01/816-4557/trouble-6/index.html
394
* http://www.ncsa.illinois.edu/UserInfo/Resources/Software/kerberos/troubleshooting.html
395
396
A good place to get help is the #openafs channel at freenode IRC:  https://webchat.freenode.net/
397
398
h2. How do I calculate the maximum cache size?
399
400
See this page:  https://wiki.mageia.org/en/Installing_OpenAFS_Client#Check_correct_cache_size_is_defined
401
402
h2. AFS's module loaded but there is nothing in /afs.  What went wrong?
403
404
You might have a cache size issue or something else stopping the client.
405
Check the logs.  On a systemd/journald system <pre>systemctl status openafs-client</pre>
406
407
h2. I can see the AFS cell, but I can't access my files in my home directory/folder
408
409
This probably means you are not getting tokens.  make sure you see "AFS tokens(1)" next to your name on the Network Identity Manager.
410
If you don't:
411
412
# Menubar: Options > Identities
413
# Click on the username@RND.RU.IS entry
414
# Select the AFS tab
415
# 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.
416
# Click "Apply"
417
418
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)
419
420
# Click on the folder, then right-click AFS > Volume/Partition > Refresh name/ID map
421
# Click on the folder, then right-click AFS > Flush File/Dir
422
# Click on the folder, then right-click AFS > Flush Volume
423
# If that doesn't work, restart AFS through the Control Panel or rebooting
424
425
426
h2. "kinit: KDC has no support for encryption type while getting initial credentials"
427
428
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
429
430
Solution:  Enable weak crypto
431
# Edit @/etc/krb5.conf@ (or equivalent) 
432
## Add @allow_weak_crypto = yes@ on the @[libdefaults]@ section
433
434
h2. While upgrading Kerberos, you get the need to restart the Kerberos Cache RPC SErver
435
436
Solution: Find the Process ID and kill it on the terminal
437
# Start Menu > Run > @taskkill /F /PID@ PID-number
438
439
h2. AFS appears to be running (windows) but no \\AFS directory
440
441
Oh boy, there are many things that can be wrong here.  First run a virus checker to look for rootkits.
442
443
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)
444
445
# open a cmd.exe as administrator
446
# regedit.exe
447
# goto HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
448
# Change the TMP and TEMP entries to a valid path that everyone can access, particularly SYSTEM
449
# Make sure that these (and windir) are all type REG_EXPAND_SZ
450
h1. Reference
451
452
* Ubuntu Serverguide to Kerberos https://help.ubuntu.com/12.04/serverguide/kerberos.html
453
454
h2. Kerberos complains about a generic error and seeing e-text
455
456
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