FAQ – Unix

Unix

How do i share a folder or files with another user or group?

Once logged in to a linux machine, open a Terminal and you’ll issue a few commands. By default, you start in your home directory (/home/username) and it may appear with a prompt to the left of the cursor indicating that (a user’s ‘home’ may be represented by the ‘~’ char).
If you don’t have a directory to share, create one with something like:

[warthogs@lab1-23 ~]$ mkdir TeamSamba

The directory inherits the default permissions, in this case rwx (read-write-execute for the owner, your username; read-execute for group; read-execute for everyone/all users:
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxr-xr-x 2 warthogs csugrad 4096 Oct 9 12:47 TeamSamba/

To verify the groupname for setting the directory permissions, find out which groups you’re a member of:
[warthogs@lab1-23 ~]$ groups
csugrad telerobotics mediashare src cs6090 cei manu

And assign one to the directory:
[warthogs@lab1-23 ~]$ chgrp telerobotics TeamSamba
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxr-xr-x 2 warthogs telerobotics 4096 Oct 9 12:47 TeamSamba/

Finally, set the permissions so the group can write files, but no other users can see in the directory:
[warthogs@lab1-23 ~]$ chmod 2770 TeamSamba/
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxrws— 2 warthogs telerobotics 4096 Oct 9 12:47 TeamSamba/

See ‘man chmod’ or ‘man chgrp’ for syntax details and more information.

Permalink.

How do i set or change the default group on my account?

You must already be a member of said group to change to it as your primary GID.
Use the command ‘groups’ to see what groups you’re a member of, first in the list is primary.

[warthogs@lab1-23 ~]$ groups
csugrad mech_adm telerobotics mechoffice mechprof mediashare src cs6090 cei manu

To change your primary GID for your current session, run the command ‘newgrp’ followed by the name of the group:
[warthogs@lab1-23 ~]$ newgrp telerobotics
[warthogs@lab1-23 ~]$ groups
telerobotics csugrad mech_adm mechoffice mechprof mediashare src cs6090 cei man

If you want the change to persist, either add the command to your login script or contact us and request that we change your accounts primary GID.

Permalink.

What ports are open on the CADE Linux Machines?

The CADE Linux machines (lab1 and lab2) only allow incoming connections on ports 22 and 2100-2120.

This means that we allow incoming SSH connections (22), and allow students to host servers on 2100-2120.

Permalink.

Computational Server

CADE no longer provides Computational Servers.

compute1.eng.utah.edu has been retired as of 10/4/2016 and files that where located under /scratch have been mounted on any lab1 or lab2 machine. The files are located at /research/scratch/{USERNAME}

/research/scratch works on auto mount. You will not see anything until moved into /research/scratch/{USERNAME}

If you need to run long computational jobs or higher-powered computing resources, we suggest getting an account with CHPC.

Permalink.

How do I set up a class account or group?

If you need a class account for a course you are teaching (to host website files, handin, etc.) we will be happy to create one for you or give you access to an existing one.  Please send a request via opers@eng.utah.edu.

The class will also have a group associated with it. This will allow you to select who has read/write privileges on the class files (such as TA’s).  You can modify users in the group by using the groupmodify command on any of the CADE lab machines, or via our web tool.

Permalink.

How do I log into a CADE machine if I get a warning message saying ‘Host Key Verification Failed’?

Likely, the message you recieved looks like this:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is(…).
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending key in /home/username/.ssh/known_hosts:xx
RSA host key for lab-machine has changed and you have requested strict checking.
Host key verification failed.
You can completely delete the existing ‘known_hosts‘ file in your .ssh directory to avoid this message and log in, or as the message states, remove the offending line. The ‘known_hosts’ file will be repopulated, and a machine entry will be added each time you log in to a different machine.

rm ~/.ssh/known_hosts

You can add the correct host key containing entries of all the CADE lab machines from a file on our website, available here.

Permalink.

How do I run GUI/X applications remotely with ssh?

If you are having problems running X applications (or GUI driven, java, etc.) remotely then most likely you need to use the -Y option instead of the -X/-x (i.e. ssh -Yl lab2-4.eng.utah.edu)

This is caused by a new change in any Openssh version newer than 3.7.1

For more information, including other options for running graphical applications consult the SSH or Remote Access FAQ pages.

Permalink.

What is SSH?

Secure Shell (SSH), sometimes known as Secure Socket Shell, is a UNIX-based command interface and protocol for securely getting access to a remote computer. It is widely used by network administrators to control desktop machines and other kinds of servers remotely.

SSH is actually a suite of three utilities – slogin, ssh, and scp – that are secure versions of the earlier UNIX utilities, rlogin, rsh, and rcp. SSH commands are encrypted and secure in several ways. Both ends of the client/server connection are authenticated using a digital certificate, and passwords are protected by being encrypted. SSH uses RSA public key cryptography for both connection and authentication. Encryption algorithms include Blowfish, DES, and RSA.

If you have Mac OS X or use Linux then you already have the tools you need to remotely log in. Please see the FAQ on “Which CADE machines can I log into” for information on the correct syntax.

For those of you who use Windows and want to be able to use SSH to remotely log in you will need to install and xserver client. We recommend using Windows PowerShell or PuTTY.  There are clients available for Windows like CygwinSecureFX, XMing and SSH for Windows.

Permalink.

How can I fix/get below my quota?

If you receive an e-mail telling you that you are over your quota or are having problems running software and get out-of-disk-space errors, you will need to delete some files from your home directory. To do this you will need to log into a machine in the CADE Lab via a virtual terminal. To do this hold down ctrl+alt and hit f4 at the login screen. You will then be dropped into a virtual terminal where you can log in with your regular name and password.

You can try and log in using the normal graphical, however this will be a very slow process.

Once you have logged in run the following command:

du -ka | sort -n

This will list all of the files you have within your home by size (in ascending order). You can deleted any files or directories that you no longer need:

rm filename to remove files

rm -rf directoryname to remove for directories – be aware- all files and subdirectories also removed.

Once you have deleted all the files you no longer need run the quota command:

quota

If you are still over you will need to delete more files. If this is not possible, please come to the Help Desk and we can discuss your situation.

If after deleting your files you find that the results of the sort command and the quota command are different (ie: the sort command says that you are under quota within your home but quota still says it is over) then it is possible that you have files elsewhere under /home.

This can happen if you have been part of any groups or teams that requires you to place files outside of your own home directory but within /home. If this happens please come to the Help Desk and we will be happy to run a search for you to locate the offending files.

Permalink.

How can I made a .tar.gz file for faster transfer/downloading?

tar zcvf directory_name.tar.gz directory_name

Permalink.

How do I … in (enter favorite programming langauge)?

Although we here at the CADE might know the answer to your question off the top of our head, most likely you are doing homework.  Try: looking in your book(s), contacting your TA, your class website, asking a classmate or your favorite search engine.

Permalink.

How do I open a tar.gz file?

Run ‘tar zxvf filename.tar.gz’ to open the file. For more information run ‘man tar’.

Permalink.

How do I … while using (enter favorite program)?

Due to the large number of programs (387 at last count) and features they offer, it would take more time than we are willing to put into it to list everything. Many programs have: pulldown Help menus, man pages (‘man pine’ would give you the man page on pine) and very helpfull websites.

If your question can still not be answered or the answer you found does not work, don’t hesitate to ask us.

We will add links below to software tutorials and usage as we find/get a chance to make them.

Matlab:  http://www.che.utah.edu/~sutherland/wiki/index.php/Main_Page

Interfacing ANSYS and LS-DYNA (OLD!!):  http://www.me.unlv.edu/~mbt/Impact_Characteristics/Interfacing%20ANSYS%20and%20LS-DYNA%20.htm

Permalink.

I have made an executable but when I run it I get error: filename: Command not found

The directory that the executable is in, is not in your path.  You may run the executable by placing ./ in front of the executable name.  See this to add the directory to your PATH environment variable.

Permalink.

How do I open a .zip file on the CADE Lab machines?

Run ‘unzip filename.zip’ to open the file. For more information run ‘man unzip’

Permalink.

Where can I add something to my PATH?

There are two ways to do this. In a shell you may type ‘setenv PATH ~/bin:$PATH’. This would add the directory ~/bin to your path.

The other way is to add the path to your .tcshrc (or other shell’s rc file).  Open your .tcshrc in your favorite text editor (ie, vim .tcshrc) and add this line:

setenv PATH $:~/bin

Again, this will create a path to your bin directory inside your home directory.  Also, when using this method, the variable will not become active untill you open up a new shell or run ‘source .tcshrc’.

bash/zsh

To add to the PATH environment variable temporarily in bash or zsh, you may type “export PATH=<newpath>:PATH” where <newpath> is the path you want to add.

To change your PATH permanently in bash or zsh, add the path to your .bashrc or .zshrc. Open .bashrc or .zshrc in your favorite text editor (ie, nano .zshrc) and add this line:

PATH=<newpath>:$PATH

Where <newpath> is the path you want to add.

Permalink.

Do you have a list of common UNIX commands?

Here is a brief list of simple Unix commands that will help you move around the file system, examine files, copy or delete files.  For help with any command, e.g. the ‘ls’ command, type ‘man ls’ in your xterm window.

FILE OPERATIONS:

ls list files
cp copy files: cp /path/name newname
mv move or rename files: mv name newname
rm remove (i.e. delete) files: rm name
chmod change mode of file permissions: chmod xxx name
cat scroll file contents: cat name
more page file contents (spacebar to continue): more name
less better pager than more? (q to quit): less name
view view file contents (:q to quit): view name
vi visual text editor (:wq to save and quit): vi name
pico pico text editor (Ctrl-X to quit): pico name

DIRECTORY OPERATIONS:

mkdir make (create) new directory: mkdir Name
cd change directory: cd /path/name
cd change to your home directory: cd
rmdir remove directory (if empty): rmdir Name
pwd print working directory (show directory name)
quota check disk space quota: quota

SYSTEM OPERATIONS:

du show disk usage
ps list your processes
kill kill a process: kill ###
passwd change your password
remote_passwd change your remote password
date show date and time
w who is doing what on the system
who who is connected to the system
cal display a calendar
ping ping another computer (is it alive?)
finger get information on users
exit exit, or logout, from the system

Most commands have options, which are described in the online man pages.

Permalink.

What’s an ‘alias’ and how do i create one?

An alias is a pseudonym or shorthand for a command or series of commands.  There are at least two ways to create an alias in Unix.  If you’d just like an alias to exist for the duration of your session, in a shell type: ‘alias p pine’.  That will create an alias ‘p’ for the mail program pine. Everytime during your current session, when you press ‘p’ followed by enter in a shell, pine will be executed.  Keep in mind that once you logout, you will lose this alias.

If you’d like your alias to be there evertime you used a CADE machine, what you have to do is open up your .tcshrc in you favorite text editor (ie, vim .tcshrc) and add your alias at the bottom of the file. For example, to add an alias ‘p’ for pine, add this line:

alias p “pine”

Note that the quotes around pine are not necessary but it allows you to read the aliases in your .tcshrc easily.  Also, when using this method, the alias will not become active untill you open up a new shell or run ‘source .tcshrc’.

Permalink.

I deleted a file I want back – Do you have backups or snapshots available?

Snapshots/Backups

Snapshots of users’ home directories are taken every hour. You can access up to 23 hourly, 6 nightly, and 52 weekly snapshots of your entire home directory in the ~/.snapshot directory. Alternatively, from any subdirectory, you can go directly to .snapshot, then the timed directory you prefer.

Note: Older backups (beyond the first weekly) are available in /backup/username/.snapshot. They are moved to a different drive space to ensure their availability.

Restoring an older version of a file is as easy as copying it from a location in .snapshot to your home directory proper. You can do this graphically (with Nautilus, for example) or with the cp command.  ‘.snapshot’ is hidden (notice the preceding ‘ . ‘).  Try:  cd ~/.snapshot  from a Terminal.

Many of the hosted network shares (for departments and research groups) are also snapshotted. As above, cd to the .snapshot directory.

Permalink.

How can we get a group for sharing files for our project?

We would be happy to create a group for you – unfortunately, we can’t allow users to create their own. Send an e-mail to opers@eng.utah.edu with the following information:
– The group-owners UNID or CADE username
– The preferred name for the group (please keep it short, and we will likely concatenate for ease; you can use ‘groupsearch’ to see if it exists already).
– Optional: the UNID’s or CADE usernames of the other team members. The owner can modify the member list later at-will via command-line (groupmodify) or web-page (www.cade.utah.edu/groupmod).

Once we reply with the details, the group owner may use the command ‘groupmodify’ to edit the member list.
Somewhere in your home directory, create a directory and assign the group privileges using chgrp and chmod. See the man pages if you need more details.

NOTE: We also offer an SVN Repository service if multiple users could be modifying files at the same time.

Permalink.

How do I add the list of CADE Lab machines and compute servers to my list of ‘known_hosts’?

Download the known_hosts file from the ssh directory and place it in the appropriate directory or add the necessary lines to your existing file. Some software may require the list to be in a specific format or that the file be renamed.
www.cade.utah.edu/downloads

Permalink.

How does one fix a “Firefox is already running” error on a Linux machine?

When logged in to a Linux lab machine or compute server, you may get the following error when opening Firefox:
“Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.”

This may occur even though no evidence of Firefox running can be found.
To remedy this, open a Terminal and run the command: foxlock

It’s a script we wrote that will remove the necessary files from your .mozilla folder and allow you to open Firefox once again.

Permalink.

Can I change my default shell from ‘tcsh’?

Yes, login to the CoE User Tools page, click the ‘Account Settings’ link. There, you can change your ‘Linux Login Shell’ to point to another in /bin (ie, csh, bash, zsh, …).

Permalink.

Can I get a MySQL database?

Yes, we have MySQL (mysql.eng.utah.edu) available for student use.

To request a database, send an e-mail to opers@eng.utah.edu and let us know you need one. We will create it and likely place a file in your home directory with the database name and your login credentials.

The databases are only accessible directly from the Linux machines in CADE (‘mysql -u username -h mysql -p’), although if there is a need, we can open them up to the Windows machines. If you place website files in your .public_html directory, you can make calls to the db, and thus access it from anywhere via www.eng.utah.edu/~username.

Permalink.