Commands We have Already Looked At


SCP - Secure CoPy

We have already seen the SCP command as a way to copy files back and forth between multiple computers. The format of this command is...

scp path/local_filename username@hostname:path/remote_filename

A basic example where the file is read from the current directory and written to the home directory on the remote computer. Note that there are no path names given on either side and the file is not renamed.

linuxserver1(10:42am): scp file.txt dhood2@linux.gl.umbc.edu:file.txt
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
file.txt             100% |*****************************| 20386       00:00    
linuxserver1(10:42am):

Another example where the file is renamed on the remote computer. It is still placed in the home directory.

linuxserver1(10:43am): scp file.txt dhood2@linux.gl.umbc.edu:newfile.txt 
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
file.txt             100% |*****************************| 20386       00:00    
linuxserver1(10:43am):

We can also place the file in some specific directory on the remote machine, it need not be written to the home directory. In this example, it is being written to the courses directory that is within the home directory.

linuxserver1(10:43am): scp file.txt dhood2@linux.gl.umbc.edu:courses/newfile.txt 
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
file.txt             100% |*****************************| 20386       00:00    
linuxserver1(10:43am):

SSH - Secure SHell

We have already seen the SSH command as a way to securely connect to a remote computer. There are several ways of formatting this command...

ssh hostname or ssh username@hostname or ssh hostname -l username

If you do not specify the username it will assume that you want to connect with the same username that you have on this local computer. Since you have a single username for all computers on the OIT network, you need not explicitly enter a username.

linuxserver1(11:09am): ssh linux.gl.umbc.edu
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
Last login: Tue Jan  7 20:23:03 2003 from linuxserver1.cs.umbc.edu
  UMBC Unified Computing Environment                 http://www.gl.umbc.edu/
  --------------------------------------------------------------------------
  If you have any questions or problems regarding these systems, please
  send mail to "systems@umbc.edu", or call the OIT Helpdesk at 410-455-3838.

  If you are logged into an OIT lab machine, and using Linux is fine
  with you and want a fast processor all to yourself, consider booting
  your machine into "Linux" and work locally!

** Notice:  Telnet will be replaced with SSH as of January 2003.
	Please visit the following URL for more information:

        http://www.umbc.edu/oit/sans/core/prod/telnet.html

** Attention CS Students:  Those working on projects which "experiment" with
   fork(), please DO NOT run these on the central Linux servers.  Instead,
   use a workstation!  All OIT open lab machines can also boot to Linux, or
   experiment on your home/dorm system!  Failed execution of these programs
   is causing service outages for hundreds of other users!!!


linux1-(11:10am): 

But you can give a username, and will need to if your local username is different that your username on GL. This might be the case if you are logging on from home and set up your username to be say your first name, and not what it is on GL. This example shows using the form username@host.

linuxserver1(11:12am): ssh dhood2@linux.gl.umbc.edu
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
Last login: Wed Jan  8 11:10:06 2003 from linuxserver1.cs.umbc.edu
  UMBC Unified Computing Environment                 http://www.gl.umbc.edu/
  --------------------------------------------------------------------------
  If you have any questions or problems regarding these systems, please
  send mail to "systems@umbc.edu", or call the OIT Helpdesk at 410-455-3838.

  If you are logged into an OIT lab machine, and using Linux is fine
  with you and want a fast processor all to yourself, consider booting
  your machine into "Linux" and work locally!

** Notice:  Telnet will be replaced with SSH as of January 2003.
	Please visit the following URL for more information:

        http://www.umbc.edu/oit/sans/core/prod/telnet.html

** Attention CS Students:  Those working on projects which "experiment" with
   fork(), please DO NOT run these on the central Linux servers.  Instead,
   use a workstation!  All OIT open lab machines can also boot to Linux, or
   experiment on your home/dorm system!  Failed execution of these programs
   is causing service outages for hundreds of other users!!!


linux1-(11:12am): 

Lastly you can use the -l username form of the command. The -l stands for "log in as this user".

linuxserver1(11:16am): ssh linux.gl.umbc.edu -l dhood2
Warning: Server lies about size of server host key: actual size is 1023 bits vs. announced 1024.
Warning: This may be due to an old implementation of ssh.
dhood2@linux.gl.umbc.edu's password: 
Last login: Tue Jan  7 15:00:33 2003 from ecs104pc01.ucslab.umbc.edu
  UMBC Unified Computing Environment                 http://www.gl.umbc.edu/
  --------------------------------------------------------------------------
  If you have any questions or problems regarding these systems, please
  send mail to "systems@umbc.edu", or call the OIT Helpdesk at 410-455-3838.

  If you are logged into an OIT lab machine, and using Linux is fine
  with you and want a fast processor all to yourself, consider booting
  your machine into "Linux" and work locally!

** Notice:  Telnet will be replaced with SSH as of January 2003.
	Please visit the following URL for more information:

        http://www.umbc.edu/oit/sans/core/prod/telnet.html

** Attention CS Students:  Those working on projects which "experiment" with
   fork(), please DO NOT run these on the central Linux servers.  Instead,
   use a workstation!  All OIT open lab machines can also boot to Linux, or
   experiment on your home/dorm system!  Failed execution of these programs
   is causing service outages for hundreds of other users!!!


linux3-(11:16am): 

Time Saver

You can save a couple of keystrokes if you are on one of the Linux PCs in the labs. You really only need to specify enough of a hostname as you may need. Linux will automatically attempt to fill out the hostname with &qout;umbc.edu" for you. So if you want to logon to the lightest loaded linux server on gl, you only need to issue the following command...

ssh linux.gl

Or if you don't care the flavor of UNIX, you can simply type...

ssh gl


passwd - Change your UNIX Password

We have seen the use of the passwd command to change our password on the UNIX system. This command is an example of a no argument command. Thus the format of this command is just the command name itself.

passwd

passwd is an interactive command, as once we have typed it we need to interact with it to complete it.

linux3-(11:16am): passwd
passwd: Changing password for dhood2@UMBC.EDU.
Old password:
New password:
New password (again):
Kerberos password changed.
linux3-(11:25am): 

quota - Find Out Your GL Quota

The quota command we have seen already. We have used it to see how much storage space you have left in your GL account. When we use this command, we have the command an option. It was the -v option. So the format that we are going to issue the command is like so...

quota -v

linux3-(11:27am): quota -v
Volume Name                   Quota      Used %Used   Partition
user.dhood2                   75000     41545   55%         63%  
linux3-(11:28am):

oitcleaner - Account Cleaning Tool

The last command that we have already seen was the oitcleaner command. As you can guess by the name this tool was developed here by UMBCs OIT department, and so this command is specific to the UMBC GL system. This command takes no options and no filenames, and thus its format is like so...

oitcleaner

linux3[5]# oitcleaner
This is the cleaner that we want
Volume Name                   Quota      Used %Used   Partition
user.dhood2                   75000     41555   55%         63%  
**** Start Quota                    ****
**** Start: Cleaning Internet Files ****
**** Done:  Cleaning Internet Files ****
**** Start: Cleaning Misc. Files    ****
find: No match.
find: No match.
rm: No match.
**** Done:  Cleaning Misc. Files    ****
**** Finding Large Files            ****
rm: remove `/afs/umbc.edu/users/d/h/dhood2/home/courses/cmsc681/681.tar.gz'? n
rm: remove `/afs/umbc.edu/users/d/h/dhood2/home/.mozilla/dhood2/jk673mme.slt/XUL.mfasl'? n
rm: remove `/afs/umbc.edu/users/d/h/dhood2/home/tmp/web/direct.tif'? n
**** Finished                       ****
Volume Name                   Quota      Used %Used   Partition
user.dhood2                   75000     41495   55%         63%  
**** End Quota                      ****
linux3[6]# 

Daniel J. Hood
Last modified: Wed Jan 8 12:51:07 EST 2003