To access and log onto a Unix system, will need:
The name of the login node does vary by system, so please consult the documentation for your system to get the correct name; the login nodes for BlueRidge, for example, are blueridge1.arc.vt.edu and blueridge2.arc.vt.edu.
Secure Shell (SSH) is a protocol for secure communication. An SSH-2 or later client running on your local system is required to logon to the and many other Unix systems.
Mac OS-X, Linux, and most other UNIX systems have a built in ssh client - simply enter the following command to log onto BlueRidge:
ssh firstname.lastname@example.org "johndoe" is your username on BlueRidge. After you have connected to the Unix host, you will be prompted to enter your logon password. Note that Unix is case sensitive, so you must enter your password in the correct case -- see Unix System Password Information. Take your time entering the password; with some ssh clients, you will not be able to use the backspace or delete key to correct a typing mistake.
If you are using a Windows machine, you will need to download an SSH client, such as PuTTY or the SSH Secure Shell Client. PuTTY is available as a stand-alone executable as well as part of a Windows installer package that includes file transfer and other tools. The Secure Shell Client comes with a graphical file transfer tool.
After you download the software, run the Secure Shell Client installation program (exe) and respond to the on-screen prompts. When the installation is complete, you should have two icons for the Secure Shell Client and the Secure File Transfer Client on your desktop.
To configure and use the SshClient program, double click on its desktop icon. When you press the Enter key, a "Connect to Remote Host" Dialog box will appear. The first time you use the client, the two fields in this dialog box will be empty; enter the full "Host name" (e.g., blueridge1.arc.vt.edu for system "BlueRidge") and your "User name" (account name or user id) in the two fields on this screen; leave Port Number set at 22 and Authentication Method set as "Password".
Click on the "Connect" button. The first time you connect to a new machine, the "Host Identification" dialog box will appear informing you that you had not previously connected to this machine and asking if you would like to save a host key in the local database of your machine. Click on "Yes" to continue. You will then be prompted to enter your password; do so and click on the "OK" button. You will then be connected to the host you have selected.
To verify that the backspace key is functioning properly, type some text on the command line and then press the backspace key to see if it functions as desired. If not, from the Edit menu, select "Settings", and then select "Keyboard"; the keyboard settings dialog box will then appear. Select both "Backspace sends delete" and "Delete sends Backspace" in this dialog and then click on "OK". Again test the function of the backspace key. If still does not function as expected, try selecting only "Backspace sends delete" or "Delete sends Backspace" and then testing if the backspace key is functioning as desired. Once the backspace key is working properly, you can save your settings by selecting "Save as" from the file menu and saving as an ssh2 profile; if you are only using ssh to access one computer, you can save the settings as "default.ssh2", if you are using multiple machines, you may wish to save the settings for each machine as a separate profile and place a shortcut to each profile on your desktop or in the start menu.
This section describes how to move files between a location machine and an System. To move or copy files within an System (e.g., from one location on BlueRidge to another), use the cp or mv commands.
SCP and SFTP provide two easy ways to transfer files when working on an OS-X, Linux, or Unix machine. The scp command can be used at the command line to do a simple transfer of files, as described in the following table:
|scp local.txt email@example.com:myfolder/blueridge.txt||Copy the file local.txt on the local machine to the file myfolder/blueridge.txt on BlueRidge (for PID johndoe).|
|scp firstname.lastname@example.org:myfolder/blueridge.txt local.txt||Copy the file myfolder/blueridge.txt on BlueRidge (for PID johndoe) to the file local.txt on the local machine.|
The sftp command is used to create an interactive file transfer session. For example, to start an SFTP session with BlueRidge, enter the following at the command prompt (where johndoe is replaced by your username):
sftp email@example.comEnter your password when prompted. Then you can enter a series of commands to transfer files (note that most normal Unix commands, such as cd and ls apply to the remote computer):
|lpwd||Similar to pwd; prints the working directory on the local computer. (pwd prints the working directory on the remote computer.)|
|lcd||Similar to cd; changes the working directory on the local computer. (cd changes the working directory on the remote computer.)|
|lls||Similar to ls; lists the files in the working directory on the local computer. (ls lists files on the remote computer.)|
|lmkdir||Similar to mkdir; creates a directory on the local computer. (mkdir creates a directory on the remote computer.)|
|get blueridge.txt local.txt||Copy the file blueridge.txt on BlueRidge to the file local.txt on the local machine. If the second file name is omitted, the source file name is retained.|
|put local.txt blueridge.txt||Copy the file local.txt on the local machine to the file blueridge.txt on BlueRidge. If the second file name is omitted, the source file name is retained.|
When finished transferring files, type exit to terminate your SFTP session.
Windows users will have to download a program to do SFTP or SCP file transfers to a Unix system. Fortunately, most SSH Clients, such as PuTTY and the Secure Shell Client, have associated file transfer tools. Other tools, such as FileZilla, are available solely for file transfers.
The SSH client PuTTY has two associated file transfer programs, PSFTP and PSCP, which closely mirror the Unix commands SFTP and SCP, respectively. They can be downloaded from the PuTTY website, which also provides extensive documentation for each:
The Secure File Transfer Client comes with the Windows Secure Shell Client and provides a graphical interface for file transfers.
To configure and use the SSH Secure File Transfer Client program, double click on its desktop icon. When you press the Enter key, a "Connect to Remote Host" Dialog box will appear. The first time you use the client, the two fields in this dialog box may be empty; if so, enter the full hostname (e.g., blueridge1.arc.vt.edu) and your userid in the corresponding two fields on this screen; leave Port Number set at 22 and Authentication Method set as "Password". Click on the "Connect" button. You will then be prompted to enter your password; do so and click on the "OK" button. You will then be connected to the host you have selected. A window consisting of two panes will be displayed: the leftmost pane contains the current directory of the local machine, the rightmost pane contains a list of the directories on the host machine (e.g., BlueRidge). You can then use the icons within these panes to navigate up or down each directory tree.
After your userid and password have been verified, the message of the day (motd) will typically be displayed:
******************************************************************* * * * * * sample message of the day * * * * * *******************************************************************
The shell prompt ("$" is the default prompt for the Bourne, Korn Shell or BASH shells, "%" is the default C shell prompt) will be displayed and you may then enter Unix commands.
To log out of the system enter the command "exit" or press the Ctrl-D key sequence. You will then be returned to your prior working environment.
Note: Some userids are customized to prevent accidental logoff using the <Ctrl-D> key sequence. If <Ctrl-D> does not logoff your session, try entering the command "exit" or "logout".
Note: If you are using a Unix workstation to access another Unix system, do not turn off the local workstation unless you are the system administrator for the local machine and follow the appropriate "shutdown" procedure.
Note: Unix operating systems are case sensitive.
Some keyboard characters have special meaning in the Unix environment; see Unix Special Characters for some of the most commonly used special characters.
Press the <Return> key (sometimes this key is labeled as "Enter" or with a large left pointing arrow) to execute Unix and user-written commands. Whenever <Return> appears in this section, press the key corresponding to this function. For example, to list the non-hidden files in the current directory:
The cat (conCATenate) command can be used to create or display the contents of files as well as to join files together. Use the following sequence of commands to create a file:
cat > my_first_file <Return> Here is a line of text. <Return> Here is a second line of text. <Return> Ctrl-DTo display the contents of the file just created, enter:
cat my_first_file <Return>For the remainder of this guide, use of the <Return> key to execute Unix and user-written commands will be assumed and not included as part of the command syntax in the example exercises.
Ctrl key sequences are executed immediately and need not be followed by an <Return> to take effect.
Unix uses key sequences to execute commands such as deleting a character, terminating an executing command, and logging off. Some of the most important key sequences include (the first key sequence listed for each function is the default for many Unix systems):
Note: the stty command can be used to reassign the backspace function to another key; see Changing System Default Key Definitions.
For example, suppose you had issued the man (display manual pages) command and decided to cancel it before it has finished executing:
man man <Ctrl-C>
Do not use <Ctrl-Z> to interrupt a command you wish to terminate; this control sequence is used suspend the current active process, but does not kill nor cleanup temporary files created by the process.
The end-of-file character has many uses. These include:
Note: Where more than one "key" is listed for a command, different Unix systems may use one or more keys to perform the indicated function. You need to be aware of the alternative keys for each function should you log onto another Unix system which does not use the set with which you are familiar.
Many commands are available to allow you to customize or modify the Unix environment according to your preferences. You may issue such commands after you are logged in to accomplish the changes you desire or place them in a customization file.
The stty command can be used both to display the current key definitions and to change them.
To display the current values of keyboard command sequences, enter:
stty -aOn some systems, the -a option is not recognized. On these systems, try using the "all" option:
stty allYou can also use the stty command to change the key sequence designated to perform a selected command. For example, to assign "@" as the "kill line" character, enter:
stty kill @You would now press the <@> key instead of <Ctrl-U> to delete the current line.
If <backspace> does not already function to delete the preceding character, you can enable it to do so by entering:
stty erase <backspace>where <backspace> is the key to which you wish to assign the backspace function.
Note: On some systems, you will receive an error message if you attempt to use the stty command to reassign a function to the key which currently performs a function.
If you are using the BASH, Bourne, or Korn shells (a "$" appears as the default command prompt), you can use the following pair of commands to assign "vt100" to the TERM environmental variable:
TERM=vt100 export TERMDo not include spaces on either side of the equal sign. The variable name TERM is entered in all upper case.
If you are using the C shell (a "%" appears as the default command prompt), use the following command to assign vt100 to the TERM environmental variable:
setenv TERM vt100
You can also customize your environment by placing desired configuration commands in the file which is loaded by the command processor when you login.
When using the BASH shell, environmental configurations are typically stored in the files .bashrc and .bash_profile. Commands placed in these files will be executed the next time you log on; commands in .bashrc will be executed whenever a new BASH shell is started.
If you are using either the Bourne or Korn Shell as your command processor, you would add these commands to the file ".profile". The next time you log in, ".profile" will be executed automatically, and the changes you have made will take effect.
If you are using the C shell (% as the default prompt) include your customization commands in ".login" or ".cshrc" file. The ".login" file is invoked once when you log onto the system and typically contains stty, setenv, and umask commands. The ".cshrc" file is invoked each time a new C Shell process is started and typically contains history, set, and alias commands.
In order to use X applications on a Unix system, you need to be running an X Windows System server on your local machine and allow X clients to display back to it.
Most Unix systems include an X Windows System server as part of their installed software and it may already be started as part of your systems GUI window manager when you log on. On OS-X systems, the X WIndows System server is not included as part of the default installation; if you wish to display X clients back to an OS-X system, you must first install the X-11 software and start your ssh connections from within an X-11 window. Otherwise, if your system does not start an X Windows System server when it boots up, consult with your System Administrator or the system documentation for information on how to initialize it.
Once you have initialized the X Windows System server on your local machine, use SSH to log onto the X Window System client machine, for example, to log onto Ithaca, you could use the command:
ssh firstname.lastname@example.orgWhen an X client is initiated on Unix system, e.g., Ithaca above, the client output will then appear in a window on your local display. You can use the X client "xclock" to test if you have properly configured the connection between your X Windows Server and the host system:
When you are finished with an X application, you can typically close the application by selecting "Quit" or "Exit" from the applications main window menu; otherwise, you can close the displayed X windows by using the mouse to select the close box or select the close window option from the appropriate menu.
ssh -X email@example.com
If you are using the Windows Secure Shell Client from a Windows machine, you will need to configure the client to enable use of the X Windows System. From the Profiles menus, select "Edit profile", select your profile, select the "Tunnelling" tab, select the "TunnelX11 connections" check box, select "OK", and from the "File" menu, select, "Save Settings".
To configure the SSH client PuTTY for X Windows, you will first need to download and install the XMing XServer for Windows. Then follow these instructions to configure and start X Windows: