4. Remotely Accessing the Linux Servers

4.1. Using the Linux servers from a PC or a Macintosh

The Linux servers may be used from a personal computer, say in a lab or your dorm room, or from a Macintosh on campus.

4.1.1. Using the Linux servers from a Public Macintosh

You can access Linux servers from a Mac by using Secure Shell (SSH), a program that simply gives you a command line interface. You will not be able to use a mouse in that window, and you will not be able to run any application that requires a graphical environment.

  1. Double click on the Terminal application, which is located in Applications - Utilities

  2. Type the command ssh username@linuxserver, where username is your Linux username and linuxserver is an appropriate Linux server name (e.g., linuxcomp1.eg.bucknell.edu), in the terminal window.

  3. You will then be prompted for your Linux password. You will login without a windowing environment. Therefore, you will only have one window and the mouse is inoperative. However, the arrow keys still work.

  4. To Logout of the Linux server type logout as usual from hostname prompt.

4.1.2. Using the Linux servers from a public Windows PC

You can access Linux servers from a laboratory PC in two ways:

  1. By using Secure Shell (SSH), a program that simply accesses the Linux servers and gives you a command line only interface. You will not be able to use a mouse in that window, and you will not be able to run any application that requires a graphical environment.

  2. By using X-Win32 a program that simulates X Windows.

To use SSH from a laboratory PC:

  1. From the Start menu, select All Programs –> Internet Applications –> Secure Shell Client.

  2. In the SSH window that appears, click the Quick Connect button.

  3. Type in a Linux server name and your Linux username in the appropriate fields; then, click the Connect button.

  4. A dialog box may appear asking if you’d like to save the new host key in your local database. Simply click Yes.

  5. Type in your password when prompted to do so and then click OK.

  6. You will be logged in without a graphical environment. Therefore, you will only have one window and the mouse is inoperative. However, the arrow keys still work.

  7. To Logout, type logout as usual from the prompt.

To use X-Win32 from a laboratory PC:

  1. Click on the Start Menu button at the bottom left corner and select All Programs –> Internet Applications –> X-Win32.

  2. After launching X-Win32, a small X should appear in the lower right hand corner of your screen.

  3. Click on the X and select one of the sessions, e.g. Linuxcomp1 Terminal or Linuxcomp1 Graphical. Terminal sessions will simply give you a command line interface and you can launch applications via the command line. Graphical sessions will present you with the interface that you receive when physically sitting at a Linux workstation.

  4. Simply login with your Linux username and password.

  5. To exit X-Win32, right-click on the X and select Close.

4.2. Transferring files to and from the Linux ystems

4.2.1. How to use FTP in Linux

The lftp command invokes the Internet standard File Transfer Protocol (FTP), which enables file transfers to and from a remote machine.

Type lftp -u username servername

[student@hostname ~]$ lftp -u student ftp.netspace.bucknell.edu
Password:
lftp student@ftp.netspace.bucknell.edu:~>

From the lftp prompt, you can type your necessary commands. The most common lftp commands are:

help - displays all the available ftp commands

quit - terminates the FTP session with the remote server and exit ftp

cd - changes the working directory on the remote machine to remote-directory

dir - prints a listing of the directory contents in the directory

get - retrieves the remote file and stores it on the local machine

put - puts a local file onto the remote machine

To get more detailed information about lftp from the man page, simply type man lftp.

[student@hostname ~]$ man lftp

4.2.2. Transferring files from a Mac to the Linux systems

There are two ways to transfer files between a Mac and the Linux systems: one is by using FETCH, and the other is by using CIFS/SMB. CIFS/SMB has a simpler interface which allows you to interact with your files just as you would with any file on your local Mac system.

4.2.2.1. Transferring files betweena Mac and the Linux systems by using CIFS/SMB

The procedure for using CIFS/SMB is as follows:

  1. From the Finder, select Go – Connect to Server…

  2. In the dialog box that appears, type in smb://unixspace.bucknell.edu/linux-username.$ (where username is your actual Linux username) and click the Connect button.

  3. Type in BUCKNELL in the Workgroup/Domain field and enter your username and password in the appropriate fields. NOTE: The password you need is your Windows network password, NOT your Linux password. There is a trust relationship that allows you to use your Windows password, in this case, to access your Linux files.

  4. Click the OK button.

  5. After logging in, a volume icon will appear on your desktop labeled linux-username.$

  6. You can now interact with this volume as you would with any other set of folder/files on your local machine.

  7. To exit, drag either the linux-username.$ icon icon to the Trash Can/Eject Button.

4.2.2.2. Transferring files between a Mac and the Linux systems by using FETCH
  1. Open the Applications folder.

  2. Double click on Fetch.

  3. In the New Connection... window, type in a valid hostname (e.g. linuxcomp1.eg.bucknell.edu or linuxcomp2.eg.bucknell.edu) for the Host.

  4. On a line that says: Username: type your username.

  5. On a line that says Connect Using: select SFTP.

  6. On a line that says Password: type your password.

  7. Click the Connect button.

  8. To transfer files to/from the Linux systems, simply drag and drop files from your local machine to/from the Fetch window.

  9. To quit Fetch, select Fetch – Quit Fetch.

4.2.3. Transfering Files from a Public PC to the Linux Systems

There are two options to transfer files between a laboratory Windows PC and the Linux systems. The first option is to use the Secure File Transfer Client (SFTP) from Internet Applications; the second choice is to map a network drive to your Linux space.

4.2.3.1. Transferring files between a PC and the Linux system by using SFTP
  1. Go to the Start Menu and select All Programs -> Internet Applications –> Secure File Transfer Client.

  2. In the window that appears, click the Quick Connect button.

  3. Type in a Linux server name and your Linux username in the appropriate fields; then, click the Connect button.

  4. A dialog box may appear asking if you’d like to save the new host key in your local database. Simply click Yes.

  5. Type in your password when prompted to do so and then click OK.

  6. Your Linux files should then appear in the right window. You can now drag files to the local machine from this window.

  7. Simply exit SFTP by closing the window when you're finished.

4.2.3.2. Transferring files between a PC and the Linux systems by using a mapped network drive
  1. On the desktop, right-click on My Computer and select Map Network Drive

  2. In the dialog box that appears, select a free drive letter (usually the default is fine) in the Drive field.

  3. In the Folder field, type \\unixspace\linux-username.$ and click the Finish button.

  4. A window containing your Linux folders/files should appear, and you can now interact with this volume as you would with any other set of folder/files on your local machine.