xref: /freebsd/contrib/smbfs/mount_smbfs/mount_smbfs.8 (revision 193d9e768ba63fcfb187cfd17f461f7d41345048)
1.\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $
2.\" $FreeBSD$
3.Dd September 17, 2011
4.Dt MOUNT_SMBFS 8
5.Os
6.Sh NAME
7.Nm mount_smbfs
8.Nd "mount a shared resource from an SMB file server"
9.Sh SYNOPSIS
10.Nm
11.Op Fl E Ar cs1 : Ns Ar cs2
12.Op Fl I Ar host
13.Op Fl L Ar locale
14.Op Fl M Ar crights : Ns Ar srights
15.Op Fl N
16.Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
17.Op Fl R Ar retrycount
18.Op Fl T Ar timeout
19.Op Fl U Ar username
20.Op Fl W Ar workgroup
21.Op Fl c Ar case
22.Op Fl d Ar mode
23.Op Fl f Ar mode
24.Op Fl g Ar gid
25.Op Fl n Ar opt
26.Op Fl u Ar uid
27.Sm off
28.No // Ar user No @ Ar server
29.Op Ar :port1 Op Ar :port2
30.No / Ar share
31.Sm on
32.Ar node
33.Sh DESCRIPTION
34The
35.Nm
36command mounts a share from a remote server using SMB/CIFS protocol.
37.Pp
38The options are as follows:
39.Bl -tag -width indent
40.It Fl E Ar cs1 : Ns Ar cs2
41Specifies local
42.Pq Ar cs1
43and server's
44.Pq Ar cs2
45character sets.
46.It Fl I Ar host
47Do not use NetBIOS name resolver and connect directly to
48.Ar host ,
49which can be either a valid DNS name or an IP address.
50.It Fl L Ar locale
51Use
52.Ar locale
53for lower/upper case conversion routines.
54Set the locale for case conversion.
55By default,
56.Nm
57tries to use an environment variable
58.Ev LC_*
59to determine it.
60.It Fl M Ar crights : Ns Ar srights
61Assign access rights to the newly created connection.
62.It Fl N
63Do not ask for a password.
64At run time,
65.Nm
66reads the
67.Pa ~/.nsmbrc
68file for additional configuration parameters and a password.
69If no password is found,
70.Nm
71prompts for it.
72.It Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
73Assign owner/group attributes to the newly created connection.
74.It Fl R Ar retrycount
75How many retries should be done before the SMB requester decides to drop
76the connection.
77Default is 4.
78.It Fl T Ar timeout
79Timeout in seconds for each request.
80Default is 15.
81.It Fl U Ar username
82Username to authenticate with.
83.It Fl W Ar workgroup
84This option specifies the workgroup to be used in the authentication request.
85.It Fl c Ar case
86Set a
87.Ar case
88option which affects name representation.
89.Ar case
90can be one of the following:
91.Bl -tag -width ".Em Value"
92.It Em Value
93.Em Meaning
94.It Cm l
95All existing file names are converted to lower case.
96Newly created file gets a lower case.
97.It Cm u
98All existing file names are converted to upper case.
99Newly created file gets an upper case.
100.El
101.It Fl f Ar mode , Fl d Ar mode
102Specify permissions that should be assigned to files and directories.
103The values must be specified as octal numbers.
104Default value for the file mode
105is taken from mount point, default value for the directory mode adds execute
106permission where the file mode gives read permission.
107.Pp
108Note that these permissions can differ from the rights granted by SMB
109server.
110.It Fl u Ar uid , Fl g Ar gid
111User ID and group ID assigned to files.
112The default are owner and group IDs from
113the directory where the volume is mounted.
114.It No // Ns Ar user Ns @ Ns Ar server Ns Oo Ar :port1 Ns Oo Ar :port2 Oc Oc Ns No / Ns Ar share
115The
116.Nm
117command will use
118.Ar server
119as the NetBIOS name of remote computer,
120.Ar user
121as the remote user name and
122.Ar share
123as the resource name on a remote server.
124Optional
125.Ar port1
126and
127.Ar port2
128arguments can be used to override default values of port numbers used
129by communication protocols.
130For SMB over NetBIOS default value for
131.Ar port1
132are 139, and
133.Ar port2
134are 137.
135.It Ar node
136Path to mount point.
137.El
138.Sh FILES
139.Bl -tag -width ".Pa ~/.nsmbrc" -compact
140.It Pa ~/.nsmbrc
141Keeps static parameters for connections and other information.
142See
143.Pa /usr/share/examples/smbfs/dot.nsmbrc
144for details.
145.El
146.Sh EXAMPLES
147The following example illustrates how to connect to SMB server
148.Em SAMBA
149as user
150.Em GUEST ,
151and mount shares
152.Em PUBLIC
153and
154.Em TMP :
155.Bd -literal -offset indent
156mount_smbfs -I samba.mydomain.com //guest@samba/public /smb/public
157mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp
158.Ed
159.Pp
160It is also possible to use
161.Xr fstab 5
162for smbfs mounts (the example below doesn't prompt for a password):
163.Pp
164.Dl "//guest@samba/public    /smb/public     smbfs  rw,noauto,-N 0   0"
165.Sh AUTHORS
166.An Boris Popov Aq bp@butya.kz ,
167.Aq bp@FreeBSD.org
168.Sh BUGS
169Please report bugs to the author.
170