1 | .\" $Id: attach.1,v 1.8 1991-08-15 16:36:37 lwvanels Exp $ |
---|
2 | .\" |
---|
3 | .TH ATTACH 1 "1 July 1991" |
---|
4 | .ds ]W MIT Project Athena |
---|
5 | .SH NAME |
---|
6 | attach \- attach a remote file system to your workstation |
---|
7 | .SH SYNOPSIS |
---|
8 | .nf |
---|
9 | attach [ [ options ] \fIfilesystem\fP ... ] ... |
---|
10 | attach -l \fIfilesystem\fP ... |
---|
11 | attach |
---|
12 | .fi |
---|
13 | .SH DESCRIPTION |
---|
14 | |
---|
15 | \fIAttach\fP is a filesystem-independent utility which allows you |
---|
16 | attach a filesystem to a directory hierarchy on your |
---|
17 | workstation. The following filesystems are currently supported: NFS |
---|
18 | (Network File Protocol), RVD (Remote Virtual Disk), UFS (Unix file |
---|
19 | system), and AFS (Andrew File System). |
---|
20 | |
---|
21 | Attach looks up \fIfilesystem\fP in attach.conf(5) or by |
---|
22 | using Hesiod(3) to retrieve the file system type, the server host, the |
---|
23 | name by which the file system is known to the server (e.g., an RVD |
---|
24 | locker name or NFS server mountpoint), and the default mount point and |
---|
25 | mode (read-only, read-write). The user may also explicitly specify |
---|
26 | this information, as described below under the -explicit option. |
---|
27 | |
---|
28 | Using the various options specified below, it is possible to supercede |
---|
29 | the default mount point and mode. In addition, the user can specify |
---|
30 | that a filesystem be nosuid, so that the operating system will not |
---|
31 | honor setuid or setgid permissions on the foreign filesystem. The |
---|
32 | system maintainer may also forcibly set a filesystem so that it will |
---|
33 | be mounted nosuid by including an entry in the attach.conf file. |
---|
34 | |
---|
35 | \fIAttach\fP will attempt to automatically create a NFS |
---|
36 | mapping using Kerberos (see \fIKerberosintro(1)\fP) for NFS |
---|
37 | filesystems so that the user will have his normal (authenticated) |
---|
38 | access to the filesystem. \fIAttach\fP will automatically run the |
---|
39 | program \fIaklog\fP for AFS filesystems, to authenticate the user |
---|
40 | with the AFS subsystem. |
---|
41 | |
---|
42 | In the case of RVD packs, it is possible to supply an RVD password if |
---|
43 | Kerberos authentication is not implemented for the RVD subsystem on |
---|
44 | the workstation and the server. If a password is required and standard |
---|
45 | input is the controlling terminal, \fIattach\fP prompts for a |
---|
46 | password. If standard input is not a terminal, \fIattach\fP will not |
---|
47 | prompt for a password, and will exit with an error status. |
---|
48 | |
---|
49 | The default mode is 'w' (read-write). |
---|
50 | Also supported are 'r' (read-only), 'n' |
---|
51 | (read-only, do not attempt to authenticate), |
---|
52 | and 'm' (read-write, attempt to authenticate, but authentication |
---|
53 | failure is not a fatal error). |
---|
54 | |
---|
55 | .PP |
---|
56 | The following arguments to \fIattach\fP modify its behavior. Default |
---|
57 | options are marked as such. Unless otherwise marked, all arguments |
---|
58 | are processed \fIin order\fP. Thus, if a -v option is followed by a |
---|
59 | -q option, the -q option will take precedence. The long and short |
---|
60 | forms of each option function identically. |
---|
61 | |
---|
62 | If no arguments are given to \fIattach\fP, a list of the currently |
---|
63 | attached filesystems will be presented. |
---|
64 | |
---|
65 | .IP "-verbose or -v" |
---|
66 | Display verbose information about a mounted filesystem, such as the |
---|
67 | NFS or RVD server and the server's filesystem name, if the attach is |
---|
68 | successful. This is the default. Use of this option automatically |
---|
69 | supresses the -printpath option. |
---|
70 | .IP "-quiet or -q" |
---|
71 | Don't display verbose information. Error messages will still be printed. |
---|
72 | .IP "-force or -f" |
---|
73 | Ordinarily, \fIattach\fP will not attempt to attach a filesystem which |
---|
74 | it believes is already attached (as indicated by its appearance in |
---|
75 | the \fIattachtab(5)\fP file), or which it thinks is being attached or |
---|
76 | detached by another process. This flag overrides this behavior and |
---|
77 | \fIforces\fP |
---|
78 | the filesystem to be attached. This option can be dangerous if used |
---|
79 | indiscriminately since a filesystem could get attached more than once. |
---|
80 | .IP "-printpath or -p" |
---|
81 | \fIAttach\fP normally prints a status message on its standard |
---|
82 | output indicating the success or failure of the attach operation. This |
---|
83 | flag causes the pathname of the mounted filesystem to be printed |
---|
84 | instead. This allows an alias which invokes the \fIattach\fP command |
---|
85 | to source a C shell command file relative to this pathname, which |
---|
86 | presumably can set up execution paths and other environment variables |
---|
87 | appropriate for the use of this filesystem. Use of this option |
---|
88 | automatically surpresses the -verbose option. |
---|
89 | .IP "-lookup or -l" |
---|
90 | This option causes \fIattach\fP to lookup the filesystem definition |
---|
91 | using either attach.conf(5) or Hesiod(3) and print out the definition, |
---|
92 | but not to actually attach the filesystem. |
---|
93 | .IP "-debug or -d" |
---|
94 | Print debugging information. This will not normally be useful to users. |
---|
95 | .IP "-map or -y" |
---|
96 | Attempt to authenticate the user with Kerberos to the filesystem |
---|
97 | server. The authentication may be necessary in order to have the |
---|
98 | proper access to the filesystem. This is the default. If the |
---|
99 | authentication fails and the filesystem is being mounted read-only, a |
---|
100 | warning is printed and the attach continues. |
---|
101 | .IP "-nomap or -n" |
---|
102 | Do not attempt to authenticate the user to the filesystem server. |
---|
103 | This implicitly invokes the -noremap options. |
---|
104 | .IP "-remap or -g" |
---|
105 | Go ahead and remap the user even if the filesystem is already |
---|
106 | attached. This is the default. |
---|
107 | .IP "-noremap or -a" |
---|
108 | Don't remap the user if the filesystem is already attached. |
---|
109 | .IP "-zephyr or -z" |
---|
110 | Subscribe to \fIZephyr\fP messages about the server host. This is the |
---|
111 | default. |
---|
112 | .IP "-nozephyr or -h" |
---|
113 | Don't subscribe to \fIZephyr\fP messages about the server host. |
---|
114 | .IP "-readonly or -r, -write or -w" |
---|
115 | Overrides the default access mode for the next filesystem. |
---|
116 | "-r" indicates read-only access, and "-w" indicates write access. |
---|
117 | .IP "-mountpoint \fImount-point\fP or -m \fImount-point\fP" |
---|
118 | Overrides the default mount point for the next filesystem. The |
---|
119 | \fImount-point\fP must be an absolute pathname. |
---|
120 | .IP "-noexplicit or -x" |
---|
121 | Tell \fIattach\fP to interpret the \fIfilesystem\fP as a Hesiod name. |
---|
122 | This if the default. |
---|
123 | .IP "-explicit or -e" |
---|
124 | Change the behavior of \fIattach\fP such that the \fIfilesystem\fP is |
---|
125 | now interpreted as \fIhost:directory\fP (in the case of NFS) or |
---|
126 | \fIhost:pack\fP (in the case of RVD) instead of as a Hesiod name. |
---|
127 | This allows arbitrary directories to be attached. When this option is |
---|
128 | used, the default mount point is \fI/host/directory\fP for NFS |
---|
129 | filesystems (\fI/host/root\fP for host:/), and \fI/host/pack\fP for |
---|
130 | RVDs. This can still be overridden by the -m option. |
---|
131 | .IP "-type \fIfilesystem-type\fP or -t \fIfilesystem-type\fP" |
---|
132 | Used with the -explicit option to tell \fIattach\fP the type of the |
---|
133 | filesystem that's going to be attached. It defaults to NFS. |
---|
134 | .IP "-mountoptions \fIoptions\fP or \-o \fIoptions\fP" |
---|
135 | Specify options for the mounting of the filesystem. The options are |
---|
136 | the same as the ones used by \fImount(8)\fP. |
---|
137 | .IP "-nosetuid or -nosuid or -N" |
---|
138 | With this option, \fIattach\fP will mount the filesystem with the |
---|
139 | nosuid option. This causes the kernel not to honor setuid or setgid |
---|
140 | permission in the filesystem. (Note: this option does not have any |
---|
141 | effect with AFS filesystems.) |
---|
142 | .IP "-setuid -suid or -S" |
---|
143 | This option can be used by a trusted user to forcibly mount a |
---|
144 | filesystem without the nosuid option. This can be used to override |
---|
145 | the fact that the system administrator |
---|
146 | has made an entry such that the filesystem would normally be mounted |
---|
147 | nosuid. |
---|
148 | .IP "-override or -O" |
---|
149 | \fIAttach\fP can be set up so that normal users cannot attach certain |
---|
150 | filsystems. A trusted user can use this option to override these |
---|
151 | restrictions. See attach.conf(5) for more information. |
---|
152 | .IP "-skipfsck or -F" |
---|
153 | This option indicates that the \fIfsck\fP command should not be run. |
---|
154 | \fIfsck\fP is normally run on RVD filesystems that are mounted |
---|
155 | read-write (exclusive) mode. |
---|
156 | .IP "-lock or -L" |
---|
157 | This option tells \fIattach\fP to lock the filesystem so that it cannot |
---|
158 | be unmounted except explicitly by one of the trusted users. This |
---|
159 | command requires the user to be in the trusted users list. |
---|
160 | .IP "-user \fIusername\fP or -U \fIusername\fP" |
---|
161 | This option allows a trusted user to perform an \fIattach\fP command on |
---|
162 | behalf of another person. The entries added to the \fIattachtab\fP file |
---|
163 | will indicate that the \fIattach\fP command was run by the specified |
---|
164 | \fIusername\fP. |
---|
165 | .IP "-host \fIhostnames\fP or -H \fIhostnames\fP" |
---|
166 | This option causes \fIattach\fP to list all filesystems that are mounted |
---|
167 | from the given \fIhostnames\fP. After this option appears on the |
---|
168 | command line, no more filesystems may be attached; only hostnames may be |
---|
169 | specified. |
---|
170 | |
---|
171 | .PP |
---|
172 | If the default mount-point for a filesystem (or the mount-point |
---|
173 | specified with the -m option) does not exist, it is created. Any |
---|
174 | directories in the path that do not exist are also created. If a |
---|
175 | directory can't be created, the attach fails. When the filesystem is |
---|
176 | detached, any directories that were created during the attach are |
---|
177 | deleted, if possible. The -all option to \fIdetach\fP causes |
---|
178 | filesystems to be detached in reverse order so that directories can be |
---|
179 | deleted properly. |
---|
180 | |
---|
181 | The first thing \fIattach\fP and \fIdetach\fP do is to attempt to read |
---|
182 | in /etc/athena/attach.conf, which can be used by the system administrator to |
---|
183 | customize the behavior of \fIattach\fP and \fIdetach\fP. See |
---|
184 | \fIattach.conf(5)\fP for more information. |
---|
185 | |
---|
186 | If an NFS attach is successful, a mapping for the user is established |
---|
187 | to the NFS server (under the restraints of the -y, -n, and -g options |
---|
188 | above). If this mapping fails on a read/write attach, the operation |
---|
189 | aborts and the filesystem is not attached. If the mapping fails on a |
---|
190 | read-only attach, a warning is printed but the filesystem is mounted |
---|
191 | anyway. |
---|
192 | |
---|
193 | When an attach is successful and the -nozephyr option is not specified, a |
---|
194 | \fIZephyr(1)\fP subscription is made for the user for filesystem |
---|
195 | status message for the appropriate server. These subscriptions are |
---|
196 | removed when the filesystem is detached. |
---|
197 | |
---|
198 | .SH EXAMPLES |
---|
199 | |
---|
200 | .nf |
---|
201 | attach -r -q -m /mymount/X11 x11 -w gnu |
---|
202 | .fi |
---|
203 | |
---|
204 | Attach the filesystem \fIx11\fP to the mountpoint /mymount/X11 in |
---|
205 | read-only mode. Then attach the filesystem \fIgnu\fP |
---|
206 | to its default mount point in write mode. Don't print success |
---|
207 | messages for either mount. |
---|
208 | |
---|
209 | .SH DIAGNOSTICS |
---|
210 | |
---|
211 | If \fIattach\fP is executed with only a single filesystem argument, |
---|
212 | the exit status will be one of the following: |
---|
213 | .TP 5 |
---|
214 | 0 |
---|
215 | No error encountered. |
---|
216 | .TP 5 |
---|
217 | 1 |
---|
218 | Bad arguments. |
---|
219 | .TP 5 |
---|
220 | 2 |
---|
221 | Generic error not included in any more specific code. |
---|
222 | .TP 5 |
---|
223 | 3 |
---|
224 | Internal fatal error. |
---|
225 | .TP 5 |
---|
226 | 10 |
---|
227 | Keberos failure. |
---|
228 | .TP 5 |
---|
229 | 11 |
---|
230 | Host communication failure. |
---|
231 | .TP 5 |
---|
232 | 12 |
---|
233 | Authentication failure. |
---|
234 | .TP 5 |
---|
235 | 13 |
---|
236 | No reserved ports available. |
---|
237 | .TP 5 |
---|
238 | 20 |
---|
239 | Bad filesystem name. |
---|
240 | .TP 5 |
---|
241 | 21 |
---|
242 | Filesystem already in use by another \fIattach\fP process. |
---|
243 | .TP 5 |
---|
244 | 22 |
---|
245 | RVD spinup needs a password and standard input is not a tty. |
---|
246 | .TP 5 |
---|
247 | 23 |
---|
248 | FSCK returned an error while validating an RVD spunup in exclusive |
---|
249 | mode. |
---|
250 | .TP 5 |
---|
251 | 24 |
---|
252 | User is not allowed to attach filesystem. |
---|
253 | .TP 5 |
---|
254 | 25 |
---|
255 | User is not allowed to attach a filesystem at this mountpoint. |
---|
256 | .TP 5 |
---|
257 | 26 |
---|
258 | The remote filesystem does not exist. |
---|
259 | .PP |
---|
260 | If more than one filesystem argument is specified, the exit status can |
---|
261 | be either 0, 1, or 3 as listed above, or: |
---|
262 | .TP 5 |
---|
263 | 2 |
---|
264 | Something went wrong with one of the filesystems. |
---|
265 | .PP |
---|
266 | If an error is encountered while manipulating one filesystem in the |
---|
267 | list, \fIattach\fP continues with the other filesystems and returns |
---|
268 | the exit status 2 after attempting to attach all the other filesystems. |
---|
269 | |
---|
270 | .SH NOTE |
---|
271 | The programs \fIattach(1)\fP, \fIdetach(1)\fP, \fInfsid(1)\fP, and |
---|
272 | \fIzinit(8)\fP are all really the same program. Typically |
---|
273 | \fIdetach(1)\fP, \fInfsid(1)\fP and \fIzinit(8)\fP are links to |
---|
274 | \fIattach\fP. Argv[0] is used to determine which one of the four |
---|
275 | programs are run. This may be overridden by specifying -P |
---|
276 | \fIprogname\fP, where \fIprogname\fP should be one of the above four |
---|
277 | program names. |
---|
278 | |
---|
279 | .SH FILES |
---|
280 | /usr/tmp/attachtab |
---|
281 | .br |
---|
282 | /tmp/attach.\fIfilesystem\fP |
---|
283 | |
---|
284 | .SH "SEE ALSO" |
---|
285 | |
---|
286 | detach(1), nfsid(1), zinit(1), zephyr(1), hesiod(3) |
---|
287 | .br |
---|
288 | `Hesiod - Project Athena Technical Plan -- Name Service' |
---|
289 | .br |
---|
290 | `Hesiod Applications Programmers' Guide' |
---|
291 | .br |
---|
292 | `Hesiod Operations and Maintenance Guide' |
---|
293 | |
---|
294 | .SH AUTHORS |
---|
295 | Robert French, Project Athena |
---|
296 | .br |
---|
297 | Theodore Ts'o, Project Athena |
---|
298 | .br |
---|
299 | John Carr, Project Athena |
---|
300 | .br |
---|
301 | Richard Basch, Project Athena |
---|
302 | .br |
---|
303 | Copyright 1988, 1990 Massachusetts Institute of Technology |
---|
304 | |
---|
305 | .SH BUGS |
---|
306 | Nosetuid is not possible for AFS filesystems. |
---|
307 | Except for 'n', modes are ignored for AFS filesystems. |
---|
308 | These are side effects of the current implementation using symbolic links. |
---|
309 | |
---|
310 | \fIAttach -p\fP with filesystems of type \fIMUL\fP will print out |
---|
311 | a newline-separated list of all the directories on which filesystems |
---|
312 | were attached. If used in conjunction with the standard \fIadd\fP and |
---|
313 | \fIsetup\fP aliases, errors will occur. It is yet undetermined as to |
---|
314 | what \fIattach -p\fP should output when used on filesystems of type |
---|
315 | \fIMUL\fP. |
---|
316 | |
---|
317 | AIX does not support nosetuid, so attach ignores the nosetuid option |
---|
318 | on this system. |
---|
319 | |
---|
320 | Mount options in attach.conf always override those on the command line. |
---|