Merge branch 'vendor/GDB'
[dragonfly.git] / usr.sbin / puffs / mount_psshfs / mount_psshfs.8
1 .\"     $NetBSD: mount_psshfs.8,v 1.24 2010/02/03 17:16:29 pooka Exp $
2 .\"
3 .\" Copyright (c) 2007-2009 Antti Kantee.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd February 5, 2012
27 .Dt MOUNT_PSSHFS 8
28 .Os
29 .Sh NAME
30 .Nm mount_psshfs
31 .Nd sshfs implementation for puffs
32 .Sh SYNOPSIS
33 .Nm
34 .Op Ar options
35 .Ar user@host[:path]
36 .Ar mount_point
37 .Sh DESCRIPTION
38 The
39 .Nm
40 utility can be used to mount a file system using the ssh sftp
41 subprotocol, making a remote directory hierarchy appear in the
42 local directory tree.
43 This functionality is commonly known as
44 .Em sshfs .
45 .Pp
46 The mandatory parameters are the target host name and local mount
47 point.
48 The target host parameter can optionally contain a username whose
49 credentials will be used by the remote sshd, and a relative or
50 absolute path for the remote mount point's root.
51 If no user is given, the credentials of the user issuing the mount
52 command are used.
53 If no path is given, the user's home directory on the remote machine
54 will be used.
55 .Pp
56 The following command line options are available:
57 .Bl -tag -width xxx
58 .It Fl c Ar nconnect
59 Opens
60 .Ar nconnect
61 connections to the server.
62 Currently, the value has to be 1 or 2.
63 If 2 is specified, a second connection is opened for the reading
64 and writing of data, while directory operations are performed on
65 their own connection.
66 This can greatly increase directory operation performance (ls,
67 mkdir, etc.) if
68 .Nm
69 completely saturates the available bandwidth by doing bulk data copying.
70 The default is 1.
71 .It Fl e
72 Makes the mounted file system NFS exportable.
73 If this option is used, it is very important to understand that
74 .Nm
75 can not provide complete support for NFS due to the limitations in
76 the backend.
77 Files are valid only for the time that
78 .Nm
79 is running and in the event of e.g. a server crash, all client retries
80 to access files will fail.
81 .It Fl F Ar configfile
82 Pass a configuration file to
83 .Xr ssh 1 .
84 This will make it ignore the system-wide
85 .Pa /etc/ssh/ssh_config
86 configuration file and use
87 .Pa configfile
88 instead of
89 .Pa ~/.ssh/config .
90 .It Fl g Ar manglegid
91 Converts remote
92 .Ar manglegid
93 to the effective gid of the file server and vice versa.
94 See
95 .Fl u .
96 .It Fl o Ar [no]option
97 This flag can be used to give standard mount options and options
98 to puffs.
99 .It Fl O Ar sshopt=value
100 Pass an option to
101 .Xr ssh 1 ,
102 for example
103 .Fl O Ar Port=22 .
104 For a list of valid options, see
105 .Xr ssh_config 5 .
106 .It Fl p
107 Preserve connection.
108 This option makes
109 .Nm
110 to try to reconnect to the server if the connection fails.
111 The option is very experimental and does not preserve open files
112 or retry current requests and should generally only be used if the
113 trade-offs are well understood.
114 .It Fl r Ar max_reads
115 Limits maximum outstanding read requests for each node to
116 .Ar max_reads .
117 This can be used to improve interactive performance on low-bandwidth links
118 when also performing bulk data reads.
119 .It Fl s
120 This flag can be used to make the program stay on top.
121 The default is to detach from the terminal and run in the background.
122 .It Fl t Ar timeout
123 By default
124 .Nm
125 caches directory contents and node attributes for 30 seconds before
126 re-fetching from the server to check if anything has changed on
127 the server.
128 This option is used to adjust the timeout period to
129 .Ar timeout
130 seconds.
131 A value 0 means the cache is never valid and \-1 means it is
132 valid indefinitely.
133 It is possible to force a re-read regardless of timeout status by sending
134 .Dv SIGHUP
135 to the
136 .Nm
137 process.
138 .Pp
139 Note: the file system will still free nodes when requested by the
140 kernel and will lose all cached information in doing so.
141 How frequently this happens depends on system activity and the total
142 number of available vnodes in the system (kern.maxvnodes).
143 .It Fl u Ar mangleuid
144 Converts remote
145 .Ar mangleuid
146 to the effective uid of the file server and vice versa.
147 .\"This is a simple special case of the functionality of
148 .\".Xr mount_umap 8 .
149 For example: you mount remote me@darkmoon as the local user "me".
150 If the uid of "me" on the local system is 101 and on
151 darkmoon it is 202, you would use
152 .Fl u
153 .Ar 202
154 to see files owned by 202 on darkmoon as owned by 101 when browsing the
155 mount point.
156 Apart from the cosmetic effect, this makes things like
157 "chown me file" work.
158 See
159 .Fl g .
160 .El
161 .Sh EXAMPLES
162 The following example illustrates how to mount the directory
163 .Em /usr
164 on server
165 .Em bigiron
166 as user
167 .Em abc
168 on local directory
169 .Em /mnt
170 with ssh transport compression enabled:
171 .Bd -literal -offset indent
172 mount_psshfs -O Compression=yes abc@bigiron:/usr /mnt
173 .Ed
174 .Pp
175 It is possible to use
176 .Xr fstab 5
177 for psshfs mounts, with SSH public key authentication:
178 .Pp
179 .Dl "abc@bigiron:/usr /mnt psshfs rw,noauto,-O=BatchMode=yes,-O=IdentityFile=/root/.ssh/id_rsa,-t=-1"
180 .Sh SEE ALSO
181 .Xr sftp 1 ,
182 .Xr puffs 3 ,
183 .Xr puffs 4 ,
184 .Xr fstab 5 ,
185 .Xr ssh_config 5 ,
186 .Xr mount 8 ,
187 .Xr sshd 8
188 .Sh HISTORY
189 The
190 .Nm
191 utility first appeared in
192 .Nx 5.0 .
193 It was inspired by FUSE sshfs.
194 .Sh CAVEATS
195 Permissions are not handled.
196 Do not expect the file system to behave except for a single user.
197 .Pp
198 Depending on if the server supports the
199 .Xr sftp 1
200 stavfs protocol extension,
201 free disk space may be displayed for the mount by
202 .Xr df 1 .
203 This information reflects the status at the server's mountpoint
204 and may differ for subdiretories under the mount root.