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