Using Your Keys in Linux
Posted: March 7, 2009
From the machine on which you made your key:
scp ~/.ssh/id_rsa.pub auser@london.cs.uri.edu
Install the key:
ssh auser@london.cs.uri.edu cp id_rsa.pub >> ~/.ssh/authorized_keys logout
Alternatively, if your machine provides ssh-copy-id, you only need to:
ssh-copy-id auser@london.cs.uri.edu
Test the key:
ssh auser@london.cs.uri.edu Authenticating with public key “imported-openssh-key” Passphrase for key “imported-openssh-key”: LONDON.cs.uri.edu Last login: Mon May 15 21:36:19 2006 from …. Problems? mailto:sysstaff@cs.uri.edu Have a nice day! auser@london ~ $
Using Your Keys in Windows
Posted:
You will need puttyGen to make your key in Windows.
You may either:
Transport the key: Using scp copy ~/.ssh/id_rsa to your Windows machine.
Or
Make the key:
- Run the puttyGen program
- Hit “Load”
- Set to “All Files(*.*)”
- Navigate to the id_rsa file you transphered over before and select the file
- Hit “Open”
- Enter the passphrase that you used before
- Hit “Save private key”
You now have a key on your local Windows machine.
To use that key:
- Run PuTTy
- Load your saved session to the CS server
- In the bar to your left go to Connection->SSH->Auth, and browse to the .ppk file you made when you saved the private key.
- Now resave your Session to the CS servers and connect
You should see:
login as: auser LONDON.cs.uri.edu Authenticating with public key “imported-openssh-key” Passphrase for key “imported-openssh-key”: Last login: Thu Apr 13 03:24:27 2006 from …. CSC412 students do not leave the Bochs emulator running! Please remember to kill your vnc sessions with vncserver -kill : when you are finished with them. Problems? mailto:sysstaff@cs.uri.edu Have a nice day! auser@london ~ $
HowTo: RSA Keys
Posted:
Making the Key
On either London.cs.uri.edu or Paris.cs.uri.edu
ssh-keygen -t rsa
You will then see
Generating public/private rsa key pair. Enter file in which to save the key (/home/ugrad/auser/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/ugrad/auser/.ssh/id_rsa. Your public key has been saved in /home/ugrad/auser/.ssh/id_rsa.pub. The key fingerprint is: My_Finger_Print_Id auser@london
Congratulations you have created your keys.
Implementing Your Keys
You need to make a file called authorized_keys
cd ~/.ssh cat id_rsa.pub >> authorized_keys
Ok now you are ready to accept keys when they are presented to you at the time of login.
Working with Subversion
Posted:
NOTE: As stated above, how you use Subversion depends on how many projects you will have in your repository. The following is currently written in a locally based uni-project centric way and is not very helpful to somebody who wants to manage many different projects using a remote server.
Importing Your Code
If you organize your files according to common convention, the actual tree of your code might be made like so:
mkdir -p ~/Documents/code/${PROJECT_1}/trunk/
touch ~/Documents/code/${PROJECT_1}/trunk/super-crunch.c
mkdir ~/Documents/code/${PROJECT_1}/tags/
mkdir ~/Documents/code/${PROJECT_1}/branches/
mkdir -p ~/Documents/code/${PROJECT_2}/trunk/
touch ~/Documents/code/${PROJECT_2}/trunk/index.php
mkdir ~/Documents/code/${PROJECT_2}/tags/
mkdir ~/Documents/code/${PROJECT_2}/branches/
mkdir -p ~/Documents/teX/${TEXDOC_1}/trunk/
mkdir ~/Documents/teX/${TEXDOC_1}/tags/
mkdir ~/Documents/teX/${TEXDOC_1}/branches/
Or, if you’re using a modern shell, you simply write:
mkdir -p ~/Documents/code/{${PROJECT_1},${PROJECT_2}}/{trunk,tags,branches}
mkdir -p ~/Documents/teX/${TEXDOC_1}/{trunk,tags,branches}
touch ~/Documents/code/${PROJECT_1}/trunk/super-crunch.c
touch ~/Documents/code/${PROJECT_2}/trunk/index.php
The most important thing about the directory listing above is the use of trunk, branches, and tags subdirectories off the main project listing. Don’t be confused by the ~/Documents root directory, as that is just to make it simple on us. You could just as easily do:
# Start our project workspace
mkdir ~/svn_projects/
# Lay out the directory structure for our first project. It is a small one.
mkdir ~/svn_projects/${PROJECT_1}/
mkdir ~/svn_projects/${PROJECT_1}/trunk/
mkdir ~/svn_projects/${PROJECT_1}/tags/
mkdir ~/svn_projects/${PROJECT_1}/branches/
# Add the entry for the first file of our first project.
touch ~/svn_projects/${PROJECT_1}/trunk/super-crunch.c
# Now we add our next projects directory structure to the workspace.
# This one will be a larger project so it uses a slightly different directory structure.
mkdir ~/svn_projects/${PROJECT_2}/
mkdir ~/svn_projects/${PROJECT_2}/trunk/src -p
mkdir ~/svn_projects/${PROJECT_2}/trunk/docs -p
mkdir ~/svn_projects/${PROJECT_2}/tags/
mkdir ~/svn_projects/${PROJECT_2}/branches/
# .. And add our first source code file to it.
touch ~/svn_projects/${PROJECT_2}/trunk/src/index.php
# And don’t forget the documentation!
touch ~/svn_projects/${PROJECT_2}/trunk/docs/readme.txt
Again, using shell globbing, this reduces to:
mkdir -p ~/svn_projects/{${PROJECT_1},${PROJECT_2}}/{trunk,tags,branches}
mkdir -p ~/svn_projects/${PROJECT_2}/trunk/{src,docs}
touch ~/svn_projects/${PROJECT_1}/trunk/super-crunch.c
touch ~/svn_projects/${PROJECT_2}/trunk/src/index.php
touch ~/svn_projects/${PROJECT_2}/trunk/docs/readme.txt
If you’re lazy or not worried about the giant mess it will make, you can add all of the projects in the ~/Documents folder (From the top directory listing above) to your svn repository very simply with the command:
svn import ~/Documents file:///${HOME}/.svn
However if you chose to go the more well designed route and used the second – and more shallow and thus faster to use – directory structure, you will have the option of using each subdirectory as its own sub-repository.
Using the second directory structure above as a perfect example of this, if you do the following you will be adding two different projects to your one repository.
svn import ~/svn_projects/${PROJECT_1} file:///${HOME}/.svn/${PROJECT_1}
svn import ~/svn_projects/${PROJECT_2} file:///${HOME}/.svn/${PROJECT_2}
The additions and changes in the last set of commands is very important. The addition of the extra last part of the third argument allows you to place different projects in different subdirectories of your repository. Don’t forget to add it if you’re using multiple projects in one repository!
NOTE: If you do forget it, all of the files in the project you are importing will be imported directly into the root directory of the repository you’re importing to and not the subdirectory for that project, and you will have a big mess to clean up. If you’re using a different repository per project, you don’t have to bother with this extra namespace but if you want multiple projects per repository this is necessary.
To list files in your repository
svn list –verbose file:///${HOME}/.svn
NOTE: If you wish to destroy your repository you can safely “rm -rf $HOME/.svn” and all of your hard work in ~/svn_projects/ will remain intact, however, you’d better make sure that you svn update if you want the latest revision that others may have submitted.
Once you have done the intial import, you can update the files under any of the project directories without modifying the repository. To commit your changes to the repository, run:
svn commit
In the directory. It will ask you to give a comment about the changes you made. If you don’t remember all the changes, you can get a quick reminder with:
svn diff -u
This will list all of your changes, with the repository copy lines starting with a “-’ sign and your local additions starting with a “+” sign.
If you want to work on your files from multiple locations, you can do:
svn checkout svn+ssh://paris/home/ugrad/username/.svn
In this case you will need to make sure each copy is up-to-date before working on it. You can do this with:
svn update
If you are unsure about whether your files are up-to-date or not-committed, use:
svn status
More complete documentation can be found at: http://subversion.tigris.org/
HowTo: SVN
Posted:
Creating a Repository
The repository is the place where your files, revisions and settings are stored on your server machine. You can have one project per repository, or you can have multiple projects in one repository. How you use Subversion should reflect the choice you made on how many projects you wish to have in your repository.
svnadmin create $HOME/.svn ls $HOME/.svn #README.txt conf/ dav/ db/ format hooks/ locks/
NOTE: In either case do not manually edit the contents of this directory. You should use the svnadmin tool as appropriate. If you do edit these files by hand you can break your repository!
NOTE: Creating a repository in a folder named ‘.svn’ can cause lots of problems if you are not sure what you are doing choose a different name.
Email Setup
Posted: March 6, 2009
While the webmail interface is fine as quick way to check your email from anywhere, you are encouraged to setup a real email client, such as Thunderbird for your regular usage. Note that the “Wizard” interface might not allow you to select secure settings (SSL/TLS). You must go back and edit the account settings afterwards to add TLS/SSL. The correct settings are:
Server (IMAP/POP/SMTP): mail.cs.uri.edu
Port numbers are (should be defaults in most programs):
IMAP (with SSL): 993
IMAP (with TLS/STARTTLS): 143
POP3 (with SSL): 995
POP3 (with TLS/STARTTLS): 110
SMTP (with SSL): 465
SMTP (with TLS/STARTTLS): 25
Note: Preferred setup for SMTP server should be SSL with authentication. This should allow you to send from almost anywhere. For IMAP and POP, it doesn’t matter whether you use TLS or SSL.
Note: From some “hotspots”, only web traffic is allowed, so you must revert to the webmail interface there.
Note: If you are going to go back and forth between using the web interface and using an email client, you probably want to use IMAP, which stores all of your messages on the server. You might choose to do this anyways, such that you have a backup copy of your email.
