CIFS, Linux, & Windows

I connect to Windows from Linux on almost a daily basis so I wanted to let others know how I connect the two OSes. There are some articles out there that will explain how to access Windows shares from Linux but they don’t explain things as simply as I would like. So first of all there are 2 common ways to connect to a Windows share from Linux.

  1. mount cifs or mount smbfs
  2. smbclient

I prefer the “mount cifs” option because smbfs is no longer supported and smbclient gives you the awkward command prompt look and feel like ftp via the command line. An example of how you would connect to a share via “mount cifs” can be seen below.

prompt:~$ mount -t cifs //machine/folder /mnt/windows -o username=travis

Keep in mind “machine” = machine name and “folder” = shared folder. Also I created the “windows” directory inside the “mnt” directory so that I would have a mount point. If the directory requires authentication you will be prompted for a password. In a medium to large organization this will more than likely be your Active Directory username and password. I’ve been using CIFS since 2007 and I’m never going back to smbfs or smbclient. I know CIFS has been around a while and I’m some what behind the times but I didn’t have a real need for it until last year. CIFS was definitely one of my top finds of last year. If anyone knows of a better solution please hit me up.

================ FYI ================

  • Windows uses the CIFS protocol to share folders
  • You may see it referred to as CIFS/SMB
  • Samba is a free implementation of SMB (both client and server)
  • Smbclient is a client program that comes with the Samba suite
  • CIFS is the latest “variant” of the SMB protocol
  • CIFS/SMB is probably the majority of network traffic in an organization (Windows environment that is)

Leave a Reply

Your email address will not be published. Required fields are marked *