================================ Connecting to Storage from Linux ================================ Using ``mount`` ~~~~~~~~~~~~~~~ This was tested on Ubuntu 16.04 with mount.cifs version 6.4 which is part of the ``cifs.utils`` package Install ``cifs.utils``: .. code:: sudo apt-get install cifs.utils Use the ``id`` command do find the local user's ``uid`` and ``gid``, optional: .. code:: id uid=1000({local user name}) gid=1000({local user group}) groups=1000({local user group}),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare),119(libvirt) Issue the ``mount`` command with proper options and credentials: .. code:: mount -t cifs -o vers=3.0,uid=1000,gid=1000,credentials=/tmp/.auth //storage1.ris.wustl.edu/${VOLUME_NAME} /mnt If using a credentials file, be sure to format as follows, removing any line whitespace: .. code:: username= password= domain=ACCOUNTS.AD.WUSTL.EDU .. admonition:: Variable replacement - ${VOLUME_NAME} should be replaced with the name of your Storage Platform volumn. - should be replaced with your Wustl key ID. - should be replaced with the password associated with your Wustl key. Using smbclient ~~~~~~~~~~~~~~~ Install ``samba-client`` ######################## In the Debian family of operating systems (e.g. Debian, Ubuntu, etc.) .. code:: sudo apt-get update && sudo apt-get install -y samba-client In the RedHat family of operating systems (e.g. RedHat, CentOS, etc.) .. code:: sudo yum install -y samba-client Empty the default samba configuration ##################################### .. code:: sudo truncate -s 0 /etc/samba/smb.conf Record your credentials in a file with restricted permissions .. code:: cat > secret < password= domain=ACCOUNTS.AD.WUSTL.EDU EOF .. code:: chmod 0600 secret .. admonition:: Variable replacement - should be replaced with your Wustl key ID. - should be replaced with the password associated with your Wustl key. Use ``smbclient`` to connect to storage with the SMB3 protocol to your storage volume. ###################################################################################### .. code:: smbclient -A secret -m SMB3 //storage1.ris.wustl.edu/${VOLUME_NAME} -c ls Domain=[ACCOUNTS] OS=[] Server=[] . D 0 Wed Jan 31 10:35:05 2018 .. D 0 Wed Jan 31 12:40:03 2018 Active D 0 Wed Jan 31 12:09:39 2018 .snapshots DHR 0 Mon Jan 29 15:22:55 2018 5368709120 blocks of size 1024. 5363531776 blocks available Or, to avoid recording credentials in a file: .. code:: smbclient -W ACCOUNTS -U -m SMB3 //storage1.ris.wustl.edu/${VOLUME_NAME} -c 'ls' .. admonition:: Variable replacement - ${VOLUME_NAME} should be replaced with the name of your Storage Platform volumn. - should be replaced with your Wustl key ID. Enter ``ACCOUNTS\$USER`` password .. code:: Domain=[ACCOUNTS] OS=[] Server=[] . D 0 Wed Jan 31 10:35:05 2018 .. D 0 Wed Jan 31 12:40:03 2018 Active D 0 Wed Jan 31 12:09:39 2018 .snapshots DHR 0 Mon Jan 29 15:22:55 2018 5368709120 blocks of size 1024. 5363531776 blocks available Use ``smbclient`` to PUT data into storage ########################################## .. code:: smbclient -A secret -m SMB3 //storage1.ris.wustl.edu/${VOLUME_NAME} -c 'cd Active; put somefile;' Domain=[ACCOUNTS] OS=[] Server=[] putting file somefile as \Active\somefile (69719.1 kb/s) (average 69719.1 kb/s) .. admonition:: Variable replacement - ${VOLUME_NAME} should be replaced with the name of your Storage Platform volumn.