Connecting to other machines/data-stores Michel Villerius
Connect to remote machine - Telnet (TELetype NETwork) - SSH (secure shell) - SFTP (ssh file transport protocol) - SCP (secure copy `uses ssh`) - FTP (file transport protocol) - rsync - Remote desktop viewer - Terminal Server Client Remote - IP address? - Hostname - VNC (virtual network computing) Local
SSH - connect encrypted to remote machine - Can use public and private key pair - #ssh-keygen to create key pair Enter passphrase leave empty for passwordless login - Open Terminal type: man ssh type: /-X -X Remote Contains public key Enables X11 forwarding. - Connect with: ssh -X hostname or ssh -X username@hostname Local Has private key
What is X11 forwarding? The X Window System (commonly X or X11) is a computer software system and network protocol that provides a graphical user interface (GUI) for networked computers. It provides windowing on computer displays and manages keyboard and pointing device control functions. In its standard distribution, it is a complete, albeit simple, display and human interface solution, which also delivers a standard toolkit and protocol stack for building graphical user interfaces on most Unix-like operating systems. The secure way to forward a graphical application is to forward your X11 packets through your ssh conection which automatically sets your DISPLAY environment variable for you when using option -X.
(S)FTP commands - sftp username@hostname ftp hostname - help Display this help text - ls Display remote directory listing - lls Display local directory listing - cd Change remote directory to 'path' - lcd Change local directory to 'path' - put Upload file - get Download file
RSYNC https://calomel.org/rsync_tips.html - Rsync is arguably one of the most powerful tools - You can backup files, transfer data from one system to another or make sure the data in two locations are identical. Rsync can do this for you without you worrying about what data has changed; it will take care of the details. - Using rsync instead of copy (cp) when interrupted it continues where it was interrupted rsync -av /usbdisk/ /localdisk/ - Using rsync over ssh instead of scp rsync -avz /usbdisk/ course@hostname:/backups/ - Deleting files on the remote machine that are no longer on the local machine rsync -avz --del /usbdisk/ course@hostname:/backups/ - Incremental backups using rsync The following example will make an incremental backup of the directory /data/working/ and put a copy of any file that changes into a dated directory in /BACKUP/. This can be used to keep a daily backup tree of any changed files and not have to overwrite the previous days files. rsync --backup --backup-dir=`date +%Y.%m.%d` -a /data/working/ /BACKUP/
Mount Network Shares 1 Know the server which is sharing 2 Know the share name 3 Know the permissions 4 know the firewall/security settings
Mount Network Shares
Mount Network Shares
Terminal adminrig@5-hkg-09-0045:~$ mount /dev/sdb1 on / type ext4 (rw,errors=remount-ro) /dev/sdb5 on /home type ext4 (rw) /dev/sdb6 on /data type ext4 (rw) gvfs-fuse-daemon on /home/adminrig/.gvfs type fuse.gvfs-fuse-daemon adminrig@5-hkg-09-0045:~$ cd.gvfs/ adminrig@5-hkg-09-0045:~/.gvfs$ ls humgen on vf-d5
Terminal Sudo smbmount //vf-d5/humgen /mnt/ -o username="lumcnet\mpvillerius" Sudo mount -t cifs //vf-humgen/humgen-data$ /data/humgen-data/ -o username="lumcnet\mpvillerius" /etc/fstab Part of the /etc/fstab file # <file system> <mount point> <type> <options> //VF-D5/humgen /home/vill/vf-d5/humgen cifs vf-solexa-data.lumcnet.prod.intern:/vol/solexa_01 vf-solexa-data.lumcnet.prod.intern:/vol/solexa_02 vf-solexa-data.lumcnet.prod.intern:/vol/solexa_03 <dump> <pass> noauto,rw,user,credentials=/home/vill/.cred 0 0 /Solexa-storage/Solexa-storage_01 nfs noauto,user,rw 0 /Solexa-storage/Solexa-storage_02 nfs noauto,user,rw 0 /Solexa-storage/Solexa-storage_03 nfs noauto,user,rw 0 0 0 0
vill@5-hkg-09-0045:~/howto$ smbclient -L \\vf-d5 Enter vill's password: Anonymous login successful Domain=[LUMCNET] OS=[EMC-SNAS:T5.6.46.415] Sharename Type Comment ------------ ------d5home$ Disk User home directories adenovirus$ Disk 6-sep smbsim2bb$ Disk MedStat Disk Medische Statistiek netdata5$ Disk Volume netdata5 Beheer Disk IRS Disk Inter-universitair Stralings Instituut MCB-CC Disk MCB Cytochemie en Cytometrie MCB-EM Disk MCB Elektronen Microscopie MCB-DN Disk MCB Ontwikkelings Neurologie BB-div5 Disk Bureau Bedrijfsvoering Divisie 5 PCcommon Disk Scratch schijf Divisie 5 MCB-GT Disk MCB GenTherapie FLDO Disk FLDO MCB-SE Disk MCB Struktuur Eiwit BureauBedrijfsvoering Disk archief$ Disk Parasitologie Disk Parasitologie KIK Disk Klinische Informatie Kunde malaria Disk Subtree voor Parasitologie MCB-VB Disk MCB Viro Biologie ToxGen Disk Toxico genetica Algemeen Disk General data divisie 5 bur-pdd Disk Buro Proefdier Deskundige PDC Disk Proefdier Centrum apps Disk Applications / installation d5apps Disk Applications / installation win32app Disk Applications Anatomie Disk Anatomie HumGen Disk Humane Klinische Genetica kg$ Disk Klinische Genetica _5_vol_F$ Disk Volume F KG Disk Klinische Genetica _5_vol_A$ Disk Volume A tsprofiles$ Disk _5_vol_Arch$ Disk C$ Disk Root Service Anonymous login successful
Questions or Comments?