Differences between revisions 51 and 83 (spanning 32 versions)
Revision 51 as of 2016-11-23 13:33:32
Size: 3420
Editor: gfreudig
Comment:
Revision 83 as of 2022-11-10 14:03:06
Size: 7630
Editor: stroth
Comment: Replace deprecated `gvfs-mount` by `gio mount`
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#rev 2018-10-15 bonaccos
Line 6: Line 7:
Recent Linux Kernels contain the userspace filesystem FUSE. This allows you to use all sorts of new an inovative ways for mounting remote fileystems with normal user privileges. Samples are the "gnome userspace virtual filesystem" and "sshfs" based on SSH.<<BR>><<BR>>
All graphical desktop file managers must use FUSE based solutions to access remote SMB/CIFS filesystems because they are running with normal user privileges.<<BR>><<BR>>
Recent Linux Kernels contain the userspace filesystem FUSE. This allows you to use all sorts of new an inovative ways for mounting remote fileystems with normal user privileges. Samples are the "gnome userspace virtual filesystem" and "sshfs" based on SSH.
Line 9: Line 9:
In all cases, the share will be mounted in `/run/user/$UID/gvfs/smb-share:server=X,share=Y` so that you can also access it on the command line. All graphical desktop file managers must use FUSE based solutions to access remote SMB/CIFS filesystems because they are running with normal user privileges.

'''In all cases, the share will be mounted in:'''
{{{
/run/user/$UID/gvfs/smb-share:server=X,share=Y
}}}
which can be used as
{{{#!highlight bash numbers=disable
cd /run/user/$(id -u)/gvfs/
}}}
to change to the directory containing the mounts on the command line or
{{{#!highlight bash numbers=disable
xdg-open /run/user/$(id -u)/gvfs
}}}
to open it in the desktop file manager.

As documented in [[Workstations/FindYourData]] the share `//itet-stor.ee.ethz.ch/$USER` is a good place to find all your accessible CIFS resources. Technical this share is an implementation of a "Distributed File System (DFS)" root for your account. Unfortunately not all desktop file managers can handle this special kind of a share. With the KDE file managers Konqueror and Dolphin you can't use this share (see [[Services/FileAccess/CIFSLinux#KDE_Konqueror.2CDolphin|Konqueror, Dolphin]]).

=== Protocol configuration ===
Recent Debian releases limit the maximum protocol version of Samba to a lower version than commonly offered by modern Windows servers. This is easily remedied by creating a minimal Samba configuration with the following string of commands:
{{{#!highlight bash numbers=disable
mkdir ~/.smb && echo -e '[global]\nclient max protocol = SMB3' > ~/.smb/smb.conf
}}}
Line 11: Line 34:
==== gvfs-mount ====
==== gio mount ====
Line 16: Line 38:
pmuster@testclient:~> gvfs-mount smb://itet-stor.ee.ethz.ch/pmuster pmuster@testclient:~> gio mount smb://itet-stor.ee.ethz.ch/pmuster
Line 26: Line 48:
pmuster@testclient:~> gvfs-mount -u smb://itet-stor.ee.ethz.ch/pmuster pmuster@testclient:~> gio mount -u smb://itet-stor.ee.ethz.ch/pmuster
Line 29: Line 51:
==== smbclient ====
smbclient is something like an interactive shell to the file server and also a good troubleshooting tool for connection problems. To connect your personal DFS root share enter:
{{{
pmuster@testclient:~$ smbclient -W d //itet-stor.ee.ethz.ch/pmuster
Enter pmuster's password:
Domain=[D] OS=[Windows 6.1] Server=[Samba 4.2.10-Debian]
smb: \>
smb: \> ls
  . D 0 Thu Oct 13 15:27:09 2016
  .. D 0 Thu Nov 24 04:55:59 2016
  home D 0 Thu Oct 13 15:27:09 2016
  project01 D 0 Thu Oct 13 15.27:09 2016

  47929224 blocks of size 1024. 37295664 blocks available
smb: \> cd home
smb: \home\>
smb: \home\> ls
  . D 0 Thu Nov 24 09:35:24 2016
  .. DA 0 Thu Nov 24 08:17:38 2016
  public_html D 0 Wed Feb 3 15:34:27 2016
  Desktop D 0 Mon May 23 14:57:56 2016
  Downloads D 0 Mon May 23 14:50:26 2016
  ....

  1536000 blocks of size 1024. 1340637 blocks available
smb: \home\> exit
pmuster@testclient:~$
}}}
With the command `help` you get a list of all available commands inside the shell.
Line 31: Line 82:
You can also mount your Samba home area with CIFS. This method is only available on computers where you have root access (i.e. this does not work on Linux workstations managed by us). '''If the command returns an error message saying "wrong fs type", make sure the package "cifs-utils" is installed.''' You can also mount your Samba home area with CIFS. This method is only available on computers where you have root access (i.e. this does not work on Linux workstations managed by us). '''If the command returns an error message saying "wrong fs type", make sure the packages "cifs-utils" and "keyutils" are installed.'''
Line 36: Line 87:
# mount -t cifs -o user=<d\your_tardis_login>,name=itet-stor.ee.ethz.ch \\\\itet-stor.ee.ethz.ch\\<d\your_tardis_login> /itet-stor # mount -t cifs -o user=<nethz_login>,domain=d //itet-stor.ee.ethz.ch/<nethz_login> /itet-stor
Line 42: Line 93:

Select on the left side '''Connect to network''' and enter the name of the share in the '''Server Address''' field, e.g. as 'smb://itet-stor.ee.ethz.ch/pmuster'.
Select on the left side '''Connect to network''' and enter the name of the share in the '''Server Address''' field, e.g. as `smb://itet-stor.ee.ethz.ch/pmuster`.
Line 49: Line 99:
==== Nemo ====
==== Cinnamon Nemo ====
Line 55: Line 104:
=== KDE Konqueror (all machines at ETH) ===
Open your Konqueror Filemanager/Webbrowser.
==== KDE Konqueror,Dolphin ====
As mentioned above Konqueror and Dolphin can't be used to access smb resources over `\\itet-stor\username`.
Line 58: Line 107:
As location, use smb://server/directory followed by <Enter>Type your username and password in the following dialog box. Open your Konqueror or Dolphin Filemanager/Webbrowser.
Line 60: Line 109:
For accessing your share provided from ID, use the following data: As location, use `smb://server/share` followed by `<Enter>`. Type your username and password in the following dialog box.
Line 62: Line 111:
{{{
Location: smb://nas-nethz-users.ethz.ch/share-u-$/username
===== ID home share =====
'''
{{{
Location: smb://nas-nethz-users.ethz.ch/share-<?>-$/username
Line 66: Line 116:
}}}'''
Line 67: Line 118:
Obs! The 'share-u-$' part of the location is dependant on the first character in your username. If your username is 'kpelle', this part of the location will change to 'share-k-$'
}}}
For accessing your D-ITET share, user the following:
The '''share-<?>-$''' part of the location is dependant on the first character in your username. If your username is '''kpelle''', this part of the location must be changed to '''share-k-$'''.
Line 71: Line 120:
{{{
Location: smb://homes.ee.ethz.ch/username
===== D-ITET home share =====
'''
{{{
Location: smb://nas-itet-01/itet_isg_homes_<nn>/username
Line 75: Line 125:
}}}'''
The homes are distributed over multiple `itet_isg_homes_<nn>` shares, to see the number to use you can look at the NFS path of your home:
{{{
pmuster@testclient:~$ ssh login.ee.ethz.ch "df ."
pmu@login.ee.ethz.ch's password:
Filesystem 1K-blocks Used Available Use% Mounted on
nas-itet-01.ethz.ch:/sco_itet_005/itet_isg_homes_03/pmuster 1536000 195072 1340928 13% /home/pmuster
pmuster@testclient:~$
Line 76: Line 134:
So the location for pmuster's home is: smb://nas-itet-01/itet_isg_homes_03/pmuster.
Line 77: Line 136:
== SSH File System == ===== D-ITET project share =====
'''{{{
Location: smb://itetnas<nn>.ee.ethz.ch/project
Username: d\username
Password: yourPrivatePassword
}}}'''
Again the NFS path of the project home is needed:
{{{
pmuster@testclient:~$ ssh login.ee.ethz.ch "df /home/mare"
Filesystem 1K-blocks Used Available Use% Mounted on
itetnas02:/usr/itetnas02/data-project-01/mare 3170549760 620497920 2539297792 20% /home/mare
pmuster@testclient:~$
}}}
So the location for the mare project home is: `smb://itetnas02.ee.ethz.ch/mare`.
Line 79: Line 151:
=== Troubleshooting ===
Depending on the way of accessing a Samba share, error messages similar to the following might appear:

 * '''gvsf-mount''': `Error mounting location: Failed to mount Windows share: Connection timed out`
 * '''nautilus''': `Unhandled error message: Failed to mount Windows share: Connection timed out`
 * '''smbclient''': `protocol negotiation failed: NT_STATUS_CONNECTION_RESET`

This indicates a failed protocol negotiation between the Samba server and your client in case the protocol version offerd by the server is higher than the client accepts. To fix this apply the protocol configuration mentioned above.

'''smbclient''' accepts the parameter "-m" to set the protocol level directly without the need to apply the protocol configuration:
Line 80: Line 162:
$ mkdir ~/tardis-home
$ sshfs <d\your_tardis_login>@login.ee.ethz.ch: ~/tardis-home
pmuster@testclient:~$ smbclient -W d -m SMB3 //itet-stor.ee.ethz.ch/pmuster
Line 83: Line 164:
But please note, that you can't do sshfs on homes.ee.ethz.ch - use login.ee.ethz.ch instead!

You can also unmount it again by typing:

{{{
$ fusermount -u ~/tardis-home
}}}

'''Please note that sshfs is not officially supported by the ISG.EE'''

Accessing Samba shares from Linux

Overview

Recent Linux Kernels contain the userspace filesystem FUSE. This allows you to use all sorts of new an inovative ways for mounting remote fileystems with normal user privileges. Samples are the "gnome userspace virtual filesystem" and "sshfs" based on SSH.

All graphical desktop file managers must use FUSE based solutions to access remote SMB/CIFS filesystems because they are running with normal user privileges.

In all cases, the share will be mounted in:

/run/user/$UID/gvfs/smb-share:server=X,share=Y

which can be used as

cd /run/user/$(id -u)/gvfs/

to change to the directory containing the mounts on the command line or

xdg-open /run/user/$(id -u)/gvfs

to open it in the desktop file manager.

As documented in Workstations/FindYourData the share //itet-stor.ee.ethz.ch/$USER is a good place to find all your accessible CIFS resources. Technical this share is an implementation of a "Distributed File System (DFS)" root for your account. Unfortunately not all desktop file managers can handle this special kind of a share. With the KDE file managers Konqueror and Dolphin you can't use this share (see Konqueror, Dolphin).

Protocol configuration

Recent Debian releases limit the maximum protocol version of Samba to a lower version than commonly offered by modern Windows servers. This is easily remedied by creating a minimal Samba configuration with the following string of commands:

mkdir ~/.smb && echo -e '[global]\nclient max protocol = SMB3' > ~/.smb/smb.conf

Command Line

gio mount

You can also connect to a Samba share on the command line. After you run that command, you can browse the share in Nautilus.

pmuster@testclient:~> gio mount smb://itet-stor.ee.ethz.ch/pmuster
Password required for share pmuster on itet-stor.ee.ethz.ch
User [pmuster]: pmuster
Domain [WORKGROUP]: d
Password: ********

To unmount a share on the command line, just add the -u flag:

pmuster@testclient:~> gio mount -u smb://itet-stor.ee.ethz.ch/pmuster

smbclient

smbclient is something like an interactive shell to the file server and also a good troubleshooting tool for connection problems. To connect your personal DFS root share enter:

pmuster@testclient:~$ smbclient -W d //itet-stor.ee.ethz.ch/pmuster
Enter pmuster's password: 
Domain=[D] OS=[Windows 6.1] Server=[Samba 4.2.10-Debian]
smb: \>
smb: \> ls
  .                                   D        0  Thu Oct 13 15:27:09 2016
  ..                                  D        0  Thu Nov 24 04:55:59 2016
  home                                D        0  Thu Oct 13 15:27:09 2016
  project01                           D        0  Thu Oct 13 15.27:09 2016

                47929224 blocks of size 1024. 37295664 blocks available
smb: \> cd home
smb: \home\>
smb: \home\> ls
  .                                   D        0  Thu Nov 24 09:35:24 2016
  ..                                 DA        0  Thu Nov 24 08:17:38 2016
  public_html                         D        0  Wed Feb  3 15:34:27 2016
  Desktop                             D        0  Mon May 23 14:57:56 2016
  Downloads                           D        0  Mon May 23 14:50:26 2016
  ....

                1536000 blocks of size 1024. 1340637 blocks available
smb: \home\> exit
pmuster@testclient:~$ 

With the command help you get a list of all available commands inside the shell.

root mount

You can also mount your Samba home area with CIFS. This method is only available on computers where you have root access (i.e. this does not work on Linux workstations managed by us). If the command returns an error message saying "wrong fs type", make sure the packages "cifs-utils" and "keyutils" are installed.

$ sudo su
# mkdir /itet-stor
# mount -t cifs -o user=<nethz_login>,domain=d //itet-stor.ee.ethz.ch/<nethz_login>  /itet-stor

Desktop File Managers

Gnome Nautilus

Select on the left side Connect to network and enter the name of the share in the Server Address field, e.g. as smb://itet-stor.ee.ethz.ch/pmuster.

Enter the details as given in the screenshot below.

nautilus.png

Cinnamon Nemo

Open the Connect to Server application and enter the details similar to the screenshot below.

nemo.png

KDE Konqueror,Dolphin

As mentioned above Konqueror and Dolphin can't be used to access smb resources over \\itet-stor\username.

Open your Konqueror or Dolphin Filemanager/Webbrowser.

As location, use smb://server/share followed by <Enter>. Type your username and password in the following dialog box.

ID home share

Location:   smb://nas-nethz-users.ethz.ch/share-<?>-$/username
Username:   d\yourNethzUsername
Password:   yourPrivatePassword

The share-<?>-$ part of the location is dependant on the first character in your username. If your username is kpelle, this part of the location must be changed to share-k-$.

D-ITET home share

Location:   smb://nas-itet-01/itet_isg_homes_<nn>/username
Username:   d\username
Password:   yourPrivatePassword

The homes are distributed over multiple itet_isg_homes_<nn> shares, to see the number to use you can look at the NFS path of your home:

pmuster@testclient:~$ ssh login.ee.ethz.ch "df ."
pmu@login.ee.ethz.ch's password: 
Filesystem                                                  1K-blocks   Used Available Use% Mounted on
nas-itet-01.ethz.ch:/sco_itet_005/itet_isg_homes_03/pmuster   1536000 195072   1340928  13% /home/pmuster
pmuster@testclient:~$

So the location for pmuster's home is: smb://nas-itet-01/itet_isg_homes_03/pmuster.

D-ITET project share

Location:   smb://itetnas<nn>.ee.ethz.ch/project
Username:   d\username
Password:   yourPrivatePassword

Again the NFS path of the project home is needed:

pmuster@testclient:~$ ssh login.ee.ethz.ch "df /home/mare"
Filesystem                                     1K-blocks      Used  Available Use% Mounted on
itetnas02:/usr/itetnas02/data-project-01/mare 3170549760 620497920 2539297792  20% /home/mare
pmuster@testclient:~$

So the location for the mare project home is: smb://itetnas02.ee.ethz.ch/mare.

Troubleshooting

Depending on the way of accessing a Samba share, error messages similar to the following might appear:

  • gvsf-mount: Error mounting location: Failed to mount Windows share: Connection timed out

  • nautilus: Unhandled error message: Failed to mount Windows share: Connection timed out

  • smbclient: protocol negotiation failed: NT_STATUS_CONNECTION_RESET

This indicates a failed protocol negotiation between the Samba server and your client in case the protocol version offerd by the server is higher than the client accepts. To fix this apply the protocol configuration mentioned above.

smbclient accepts the parameter "-m" to set the protocol level directly without the need to apply the protocol configuration:

pmuster@testclient:~$ smbclient -W d -m SMB3 //itet-stor.ee.ethz.ch/pmuster


CategoryEDUC

Services/FileAccess/CIFSLinux (last edited 2022-11-10 14:03:06 by stroth)