Introductory Note 832 Accessing Your University ... - Cardiff University
Introductory Note 832 Accessing Your University ... - Cardiff University
Introductory Note 832 Accessing Your University ... - Cardiff University
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
˜<br />
<strong>Cardiff</strong> <strong>University</strong><br />
School of Computer Science & Informatics<br />
Prifysgol Caerdydd<br />
Ysgol Cyfrifiadureg a Gwybodeg<br />
<strong>Introductory</strong> <strong>Note</strong> <strong>832</strong><br />
<strong>Accessing</strong> <strong>Your</strong> <strong>University</strong> Files Remotely from Linux<br />
PCs and Laptops<br />
Robert Evans<br />
22 nd September, 2012<br />
Copyright c○2009, 2010, 2012 Robert Evans.<br />
Email: Robert.Evans@cs.cardiff.ac.uk<br />
Abstract<br />
Users with a Linux PC or laptop outside the Computer Science network – at<br />
home, in Halls of Residence or elsewhere on the Internet, can access their <strong>University</strong><br />
files on the School’s fileservers.<br />
Users can access their Windows Novell H: drive, their Linux home directory,<br />
their Users web site and their Project web site. This <strong>Note</strong> tells you where to find<br />
these files and how you can access the files from a Linux PC or laptop.<br />
Contents<br />
1 <strong>Accessing</strong> Files Remotely from Linux 1<br />
1.1 Why Access Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
1.2 Fileservers and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
1.3 Using Nautilus or caja to Connect to a Fileserver . . . . . . . . . . . . . 2<br />
1.4 Using Konqueror to Connect to a Fileserver . . . . . . . . . . . . . . . . 5<br />
1.5 Using sshfs to Connect to a Fileserver . . . . . . . . . . . . . . . . . . . 6<br />
1.5.1 sshfs prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
1.6 Using davfs2 to Connect to a Fileserver . . . . . . . . . . . . . . . . . . 7<br />
1.7 Filezilla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Computer Science & Informatics: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong><br />
1 <strong>Accessing</strong> Files Remotely from Linux<br />
1.1 Why Access Files<br />
Files on the School’s fileservers can be accessed from the <strong>University</strong> Campus network,<br />
the wireless network, home, Halls of Residence or elsewhere on the Internet.<br />
You may want to access files so that you can download them to continue working, so<br />
that you can upload completed work, or simply to back-up work from your own PC or<br />
laptop.<br />
1.2 Fileservers and Files<br />
Students in the School will use Windows PCs, and Linux and Macintosh systems.<br />
They also have a “Users” and a “Project” web site.<br />
So you have five different filespaces:<br />
• for Windows - your Windows home directory which appears as the H: drive<br />
when you log in to one of the <strong>University</strong>’s Microsoft Windows PCs on the Novell<br />
network.<br />
• for Linux - directory /home/scmxxx. Each user, scmxxx, has a home directory<br />
which is seen as /home/scmxxx when they log in to one of the School’s Linux<br />
systems.<br />
• for Macintoshes - the user’s home directory. This appears as the home icon in<br />
the Finder when the user logs into one of Macintoshes in the School’s laboratory.<br />
• for the Users site - the filespace associated with your Users web pages.<br />
• for the Project site - the filespace associated with your Project web pages.<br />
For remote access, we have four gateway fileservers - driveh, home, machome and<br />
websites (which is used to access files on both Project and Users web servers).<br />
So choose the fileserver corresponding to whichever filespace you want to access:<br />
• to access your H: drive - your Novell Windows home directory, connect to fileserver<br />
driveh.cs.cf.ac.uk.<br />
• to access directory /home/scmxxx - your Linux network home directory, connect<br />
to fileserver home.cs.cf.ac.uk.<br />
• to access your Macintosh home directory, connect to fileserver machome.cs.cf.ac.uk.<br />
• to upload or amend files on the Users web server, connect to fileserver<br />
websites.cs.cf.ac.uk and navigate to the users directory.<br />
• similarly, to upload or amend files on the Project web server, connect to fileserver<br />
websites.cs.cf.ac.uk and navigate to the project directory.<br />
1.3 Using Nautilus or caja to Connect to a Fileserver<br />
Nautilus is the file manager application in GNOME 2 desktops like older versions of<br />
Ubuntu and Fedora. A version is also in GNOME 3 desktops like Ubuntu’s Unity, LinuxMint’s<br />
Cinnamon and GNOME Shell. Caja is the same file manager in LinuxMint’s<br />
Mate graphical user interface.
Information for Users: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong> 3<br />
Start the nautilus or caja file manager from the applications menu of your Linux distribution.<br />
Alternatively, you can start it from a home directory icon, or a Computer icon<br />
or similar which may be found on the desktop or on the dashboard.<br />
When you have an open nautilus or caja<br />
window, you can use Connect to Server...<br />
from the File menu.<br />
In the Connect to Server dialogue window,<br />
choose SSH as the Service type and type in<br />
the name of the server. Put your username<br />
is the User Name field. Click the Connect<br />
button.<br />
You will be prompted for your password.<br />
Type it in the Password field and check<br />
Remember password until you logout to<br />
prevent nautilus or caja from asking for<br />
your password again and again.<br />
(<strong>Note</strong> – use your standard password<br />
even if you are connecting to machome;<br />
do not use your Macintosh password.)<br />
Once the connection is made, a file manager<br />
window opens. You can drag files between<br />
the window and the desktop, or other<br />
nautilus or caja file manager windows.
4 Computer Science & Informatics: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong><br />
To delete a file, drag it to your wastebasket.<br />
On some versions of Linux, this is called the<br />
Deleted Item folder. Alternatively right-click<br />
on the file icon to obtain an options menu,<br />
and select Move to the Delete Items folder<br />
or Wastebasket, or select Delete from that.<br />
The connection will create an icon on your<br />
desktop. If you close the file manager window,<br />
you can re-open it by double-clicking<br />
on the icon.<br />
When you have finished, right-click on<br />
the icon and disconnect from the server by<br />
selecting Unmount Volume from the menu.<br />
Some very old versions of nautilus may not be able to use SFTP at all. In these<br />
cases, you can use Secure WebDAV (HTTPS) instead. Perversely, however, Secure<br />
WebDAV does not work on some newer versions of nautilus on GNOME 2 desktops<br />
(those in GNOME 2.22 or later). Both SFTP and Secure WebDAV work in nautilus in<br />
GNOME 3 and in caja.<br />
If you have a working version of nautilus or caja, connection using Secure WebDAV is<br />
accomplished in the same way as connection via SFTP.
Information for Users: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong> 5<br />
1.4 Using Konqueror to Connect to a Fileserver<br />
Konqueror is the file manager and web browser application in the KDE desktop.<br />
To start the konqueror file manager in the<br />
KDE desktop, click on the home directory<br />
icon in the menu bar.<br />
Alternatively, just type konqueror in<br />
a terminal window.<br />
Open the Location pull-down menu and select<br />
Open Location....<br />
You can now type a location to access your files on one of the School’s gateway<br />
fileservers. If your username is scmxxx, and the server is SSS, the location is<br />
sftp://scmxxx@SSS.cs.cf.ac.uk/<br />
In this example, we are connecting to<br />
filespace on the websites web server.<br />
<strong>Note</strong> that once you have typed the server<br />
name, konqueror may prompt you to accept<br />
the server’s host key. Click on Yes to accept<br />
it.<br />
You will be prompted for your password.<br />
Type it in the Password field. You can<br />
check the Keep password box to save the<br />
password in the KDE Wallet password<br />
store.<br />
(<strong>Note</strong> – use your standard password<br />
even if you are connecting to machome;<br />
do not use your Macintosh password.)
6 Computer Science & Informatics: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong><br />
Once the connection is made, the remote<br />
directory is displayed in the konqueror window.<br />
You can drag files between the window<br />
and the desktop or other konqueror<br />
windows.<br />
To delete a file, right-click on the file icon to<br />
obtain an options menu, and select Delete.<br />
If you naviagte away from the remote directory,<br />
you can make konqueror return to it by<br />
selecting its location from the Go pull-down<br />
menu.<br />
Bugs: Some versions of konqueror apparently don’t work with SFTP. In<br />
these cases, you can use Secure WebDAV (HTTPS) instead. For example,<br />
open location<br />
webdavs://scmxxx@websistes.cs.cf.ac.uk/<br />
<strong>Note</strong> the protocol specification is webdavs instead of sftp.<br />
1.5 Using sshfs to Connect to a Fileserver<br />
The sshfs application is a FUSE program which will mount filesystems from SFTP<br />
servers.<br />
FUSE (Filesystem in Userspace) is an interface which allows user programs, such as<br />
sshfs, to export a virtual filesystem to the Linux kernel. In this way, such filesystems<br />
can be attached to the Linux file hierarchy. This is particularly useful if you want to use<br />
Linux commands, scripts or programs to access your files on the remote server.<br />
If you have access to FUSE on your Linux workstation or laptop, you can use sshfs to<br />
mount any of our gateway fileservers. First, you need to create a local directory as the<br />
mount point for the remote filesystem. Then give the sshfs command to mount your<br />
files from the fileserver. The format of the command is:<br />
sshfs user@host:<br />
mountpoint
Information for Users: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong> 7<br />
For example, type the following in a terminal window to mount your Project web site<br />
files in a sub-directory of your local home directory called myprojecsite:<br />
mkdir ˜/myprojectsite<br />
sshfs scmxxx@websites.cs.cf.ac.uk:websites/scmxxx/project ˜/myprojectsite<br />
Sshfs will prompt you for your password. Use you standard <strong>University</strong> password (for<br />
all servers websites, driveh, home, and machome). You will then see your Project<br />
web site files in directory /myprojectsite.<br />
ls ˜/myprojectsite<br />
cgi-bin E.G.User index.htm TestScriptSchoolsComscZ.pdf<br />
To unmount (disconnect) the fileserver, use the fusermount -u command:<br />
fusermount -u ˜/myprojectsite<br />
1.5.1 sshfs prerequisites<br />
FUSE and sshfs must be installed on your Linux PC or laptop. If they are not, you will<br />
need root or sudo permissions to install them.<br />
For Ubuntu, LinuxMint and Debian, you can install sshfs and FUSE with:<br />
sudo apt-get install sshfs<br />
On Fedora, FUSE and sshfs come as standard packages from the Fedora repositories.<br />
Package fuse-sshfs contains sshfs. As root type:<br />
# yum install fuse-sshfs<br />
This will install sshfs and FUSE.<br />
On CentOS or RHEL, FUSE and fuse-sshfs are available from the RPMforge<br />
repository. Go to https://rpmrepo.org/RPMforge/Using to see how to add RPMforge<br />
as a yum repository and then install sshfs as above.<br />
On Fedora and RHEL or CentOS, the user must belong to group fuse in order to<br />
mount remote filesystems with the sshfs command.<br />
To add yourself to group fuse, edit file /etc/group (as the root user, or with sudo).<br />
Find the line:<br />
fuse:x:474:<br />
and add your username to the end, separated by a comma from other usernames, if<br />
present. (The group number may differ).<br />
1.6 Using davfs2 to Connect to a Fileserver<br />
With davfs2 you can mount a WebDAV server into your local filesystem.<br />
The following explains how to use davfs2 on LinuxMint 13, something similar will apply<br />
to other distributions of Linux.<br />
Use apt-get to install davfs2:<br />
sudo apt-get install davfs2
8 Computer Science & Informatics: <strong>Introductory</strong> <strong>Note</strong> <strong>832</strong><br />
Now you can create local directory and mount your filespace on one of our gateway<br />
servers into it. The format is:<br />
mount -t davfs -o uid=myname https://SSS.cs.cf.ac.uk/ mountpoint<br />
In this, myname is your username on your own PC or laptop, and SSS is one of the<br />
School’s gateway server. For example, to connect to your Novell H: drive:<br />
mkdir ˜/h<br />
sudo mount -t davfs -o uid=myname https://driveh.cs.cf.ac.uk/ ˜/h<br />
You will be prompted for your username and password.<br />
Now the files can be accessed through directory h.<br />
To disconnect from the server, use umount to unmount the directory:<br />
sudo umount ˜/h<br />
1.7 Filezilla<br />
Filezilla is a portable STFP application available on all platforms. It gives you a window<br />
divided vertically such that the left-hand panel is a view of the local file system, while<br />
the right-hand panel is a view of the remote file system. You can drag and drop files<br />
between the two.<br />
If you prefer to use Filezilla, it can be downloaded from http://filezilla-project.org/.