Samba

Access to Linux file systems via samba

Available file systems

Some Linux file systems are accessible via Samba from a server named samba (a.k.a. samba-linux).
The following shares are available:

  • //samba/username
    The Linux home directory for the account username.

  • //samba/web-docs
    The web-docs directory for the account username.

  • //samba/scratch
    The Linux scratch directory for the account username.

Setting your Samba password

Prior to first use an initial password for Samba has to be set. For this you'll have to login to samba.gsi.de via ssh with your current Linux password, then you'll have to enter your new Samba password and repeat it for confirmation. You'll be logged off automatically after this process.
username@lx-pool:~$ ssh samba
username@samba's password: 
Linux lxsmb01 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC 2014 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Jun 13 11:11:11 2014 from lx-pool.gsi.de
Quering your new samba password
New SMB password:
Retype new SMB password:
Your password has been set successfully
Connection to samba closed.

Accessing Samba volumes from Linux

Samba volumes can be used like ftp servers via smbclient. There are also some file managers which are able to deal with smb connections.

Using the smbclient command line tool

To access SMB shares in a ftp-like session you can use the command smbclient. For instance to get access to the windows scratch file as user "jdoe" you'll have to enter:
smbclient -U jdoe -W campus //winscratch/scratch
This command will ask for the windows password of "jdoe".

During the session you can use the familiar ftp commands like dir (show directory content), cd bla (change to directory "bla") and get blubb (download file "blubb"). Use the commands quit or exit to close the session again.

Accessing a Windows volume with the KDE file manager konqueror

If you are using the graphical KDE desktop, the mighty konqueror grants you easy access to SMB shares.
  1. Start the konqueror.
  2. Enter smb://campus/ in the location field to show the available hosts.
    You can also enter the complete path to the Windows volume, e.g. smb://winfilesve/DVEE$Root/jdoe
  3. Enter username, e.g. campus\jdoe and your Windows password in the dialog box (click to enlarge):
    SMB auth Konqueror
  4. Here you are (click to enlarge):
    SMB access Konqueror

Accessing a Windows volume with the KDE file manager dolphin

  1. Start the dolphin
  2. Configure dolphin and enable "editable location bar" and "show full path inside location bar" and apply these settings
  3. Enter smb://campus/ in the location field to show the available hosts.
    You can also enter the complete path to the Windows volume, e.g. smb://winfilesvf/IT$Root/jdoe (the correct path can be found on the terminal server)
  4. Because you can only copy files inside the dolphin it is a good idea to split the screen of dolphin to drag and drop

Some useful hints

  • Be aware that Windows uses the backslash character \ as path separator, while Linux uses the regular slash /. For this you'll have to use \\samba\username for connecting to your Linux home directory from Windows clients.

  • To access files or folders with names containing special characters like spaces or dollar signs from the Linux command line you will have to escape them with backslashes, e.g. //winfilesvx/xyz\$group.

  • Symlinks are only working inside a share. Since ~/web-docs is located on a separate file system you can't access it by following the link in your home directory. Please use the dedicated share //samba/web-docs instead.

  • There is a known file locking issue when editing Microsoft Office documents (e.g. .doc, .xls, …) inside a Samba share with Office2003. Please upgrade to Office2010 or save the file on a native Windows file system (e.g. My Documents) and copy/move it onto the Samba share afterwards.

  • Instead of using a Samba share you may use any scp client (e.g. WinSCP) on your Windows client for transferring data from or to Linux file systems.

  • Sometimes the connection to the Linux Samba server fails, especially with clients using Windows 7. In this case try to connect as a different user with a domain name different from CAMPUS, e.g. SCHAMPUS\jdoe.

See also

-- HelmutKreiser, ChristopherHuhn, StefanHaller - 2005…2014
Topic revision: r26 - 2016-04-01, KatharinaMader