Linux is not an officially supported platform and these instructions are offered only as a convenience for technically oriented users.

To access file shares from off campus on a Windows, macOS, or Linux device, you must first be connected to the VPN.

Install Samba Client tools

Popular Linux distributions come with package managers which should contain a client to allow you to connect to a Samba server. The commands to install Samba clients on some of the more popular distributions are below:

  • Ubuntu/Debian:
    apt-get install smbfs smbclient
  • CentOS/Fedora/RedHat
    yum install samba-client cifs-utils smbclient

The installation of the packages above allow you to directly mount a samba share or connect to a samba share using the smbclient command line utility. For more information see the documentation for your distribution; e.g. Ubuntu Samba Client Guide.

Select a Samba Share

Network Share (P Drive): This is a network share that nearly everyone in the college has access to but with differing levels of privilege; e.g. only people in the Athletics department may have access to the Athletics directory. The address for this share is:

  • \\\shared

Two Methods to connect to Samba with Linux

  1. Connecting to Samba with smbclient: This allows you to simply connect to samba without having to understand the basics of Lafayette’s implementation of MS-DFS (Microsoft’s Distributed File System). After you are connected you can upload or download files to the server.
  2. Mounting a Samba Share into your file system: If you have a Linux workstation and want your samba shares to always be available as part of your file system so you can work directly on the samba share (as opposed to a copy on your local file system), then you can use this method. Because this method does not support MS-DFS (Microsoft’s Distributed File System) you first need to query the DFS server ( to determine the exact server and share name that you want to mount.

Method 1: Connecting to file shares with smbclient

smbclient is an ftp-like command line tool you can use to connect to a samba server and upload or download files. smbclient supports MS-DFS (Microsoft’s Distributed File System). To access the Samba shares described in the previous section of the document use the following commands with $netid replaced by your Lafayette NetID:
smbclient // -U $netid

You will then see a prompt:
Enter your password:
Type your password, then press enter. If the logon was successful, you should see something like:
Domain=[DOMAIN] OS=[Unix] Server=[Samba x.y.z]
And a shell prompt:
smb: \>
Now that you are connected, there are many commands at your disposal, including:

  • ls : lists all files/subdirectories of the present directory
  • cd [dirname] : moves to the directory specified by [dirname] on the remote server
  • lcd [dirname : moves to the directory specified by [dirname] on the local machine
  • mkdir [dirname] : makes a directory with the specified name in the present directory
  • rmdir [dirname] : deletes the specified directory
  • rm [filename] : deletes the specified file
  • get [filename] [localfilename] : downloads the specified file to the local machine. If [localfilename] is specified, renames the file to that on the local machine.
  • put [local file name] [remote file name] : copies the file with name [local file name] on the local machine to the server, with name [remote file name], if specified
  • exit : terminates the connection
  • help : displays a list of commands. ‘help command’ will give you information about ‘command’

Note that accessing a different Samba share will require you to log out of smbclient and connect again to the new share. For instance, if you have access to two shares, ‘home’ and ‘shared’, if you access the ‘home’ share and want to transfer a file from there to the ‘shared’ share, you will have to download the file from ‘home’ (via the get command), log out, log on to the ‘shared’ share, and upload the file.

Method 2: Mounting a Samba Share into your file system

Lafayette’s Samba servers support MS-DFS (Microsoft’s Distributed File System) so that the server and share name can be transparent for users of Microsoft Windows. Lafayette ITS supports Samba access from the Macintosh by providing a client which can discover and mount the appropriate file server and share for any valid user. If you are using Linux, don’t want to use smbclient, and want to mount a Lafayette samba share directly, then you need to query Lafayette’s the MS-DFS server ( to determine which shares you have access to. To query an MS-DFS server you can run the rpcclient command, which is provided by installing the Samba Client described above. The rpcclient command can be run like the following where $netid is your Lafayette NetID:
rpcclient –username=’$netid’ –command=’dfsenum 3′

When running the above you should see output like the following:
$ rpcclient –username=’jetsong’ –command=’dfsenum 3′
Enter jetsong’s password:
path: \\SAMBA0\home
state: 1
num_stores: 1
storage[0] server: samba0
storage[0] share: home
path: \\SAMBA0\home\jetsong
state: 1
num_stores: 1
storage[0] server:
storage[0] share: home_staff
path: \\SAMBA0\shared
state: 1
num_stores: 1
storage[0] server: samba0
storage[0] share: shared
path: \\SAMBA0\shared\psychology
state: 1
num_stores: 1
storage[0] server:
storage[0] share: psychology

Based on the output of the rpcclient command you should choose the share you want to mount; e.g. George Jetson (jetsong) could pick ‘’ as the server and ‘psychology’ as the share because he sees that the “storage[0] server” is smbfile4. It’s important not to confuse this with the path which says SAMBA0 (which is really just the DFS server).
Once you have picked the server and the share you can use the mount.cifs command to connect to the share as in the following:
sudo mount.cifs // /smb/psychology -o user=jetsong

In the above example George Jetson (jetsong) is mounting the psychology share that he discovered earlier using the rpcclient command as documented above. The command above assumes that /smb/psychology is an existing mount point on his file system. George is then free to interact with /smb/psychology as if it were a part of his file system provided that his computer remains on the network. If he were to disconnect, then he would use the unmount command (e.g. ‘sudo unmount /smb/psychology’).

Tagged in: