Skip to content →

Month: October 2012

Use PuTTY to manipulate files on your hosting service

In this brief post, I am writing down the three key inputs to setting up a PuTTy connection.

Why do I need PuTTY?

PuTTY allows us to log on to your remote server and move files around the space that we have rented there.

Retrieve files from the internet

For example, once we  have used PuTTY to log in into our rented space on our remote server, we can use the wget command to fetch a file from the internet.

e.g. wget http://ftp.drupal.org/files/projects/drupal-7.15.tar.gz

Manipulate files and directories in our space on the server

We can also use PuTTY to unzip that file.  As the file in the example above is a tar file, the command is a little more complicated than unzip filename

tar –xvzf drupal-7.15.tar.gz

tar -xvf whatever.tar

While we are logged in to our rented server space using PuTTY, we can also make a directory

mkdir newdirectoryname

And rename a directory

mv oldname newname

And remove an empty directory or a file

rm directoryname

rm filename

Move files between Windows and our server space

In theory we can move files between a Windows machine and our server.  This did not work on my server and their support helpfully referred me to the help page I was using and querying.  Maybe these commands work elsewhere.

From Windows to your server

scp username@linuxMachineAddress/linux directory path C:Documents/filename.extension

From our server to windows

pscp ftpusername@server.hosthame.com:/home/ftpusername/helloWorld.txt C:Document/shelloWorld.txt

Install PuTTy

PuTTY is a tool rather than a Program.  That is, it doesn’t install in the Programs on Windows.  Download it to wherever you store your tools.  I have a directory c:/tools (the lowercase t reminds me this is a user directory and not a default folde that came with the computer and the standard install of Windows).

Download PuTTY.exe here.

Set up PuTTY

To use PuTTY on a Windows machine, you simply double click on the icon in c:/tools and select Run. A menu opens and you have a baffling array of choices.

Fortunately, you are able to store your choices.  The most convenient thing to do is to store the setup of PuTTY for each connection you are likely to make. That way, when you come back, you only have to pick your settings from a list.

For example, if you website is on server99 at dreamhost.com, you want to set up PuTTy to connect to server99.dreamhost.com.  Let’s also imagine that you have two users on server99. You have one set of settings for user1 at server99 and another set of settings for server 2.  You save both sets of settings separately as user1settings and user2settings.  In future, you simply pick the correct settings, PuTTY will connect to the server for you and you are then asked for your Password.

The key settings are

  • Session:  Enter your host name (e.g. server99.dreamhost.com) and select SSH
  • Data: Input your ftpusername in Auto login username
  • SSH: Select “2 only”
  • Session: Enter a descriptive name into Saved Sessions and Save

Notes: On Dreamhost, you have an account (that you pay for). Withing that account, you will have space on one of their servers; hence a server name.  On that server, you can create any number of users with names you provide.  Within that user, you can host more than one website though Dreamhost prefers to set up a separate user for each website so that the damage is limited if that user gets hacked.

Run PuTTY

When you need to connect to your server:

  1. Go to c:/tools (or wherever you stored PuTTY)
  2. Doubleclick and Run
  3. Select your settings and open
  4. When you are asked for your password, type in your FTP Password (that you set up on your server when you set up your account or set up a new user)
  5. PuTTY gives no indication that you are typing. Do not worry. Type the password accurately and press Enter.
  6. There is a short delay and then you are in to your server.
  7. To exit PuTTY, type exit<enter>.

Moving around your space

Important commands for moving around your space and staying oriented are

List files: ls

Change directory downwards: cd directoryname

Go to root: cd

Go up a directory cd  ..

Now you are equipped to log on to your server in a few clicks and a password, to upload and download files, to unzip files, to rename directories, to delete directories.

Notes:  A question to myself.  Do you not need shell access to use PuTTY. When you are logged in to Dreamhost, you can request shell access for any user (remember you set up users within your account and you will have to request this for each one.).

One Comment

How to make a picture (.png with a transparent background using Microsoft Office

I wanted to make a little text logo with a transparent background for a logo.  This is how I did it using only Powerpoint and Microsoft Office Picture Manager.

1 Use Powerpoint to make the logo in WordArt

  1. Open Powerpoint and a new presentation
  2. Insert WordArt and add your text
  3. Right click to allow you edit the Text Effects and Shape. Patiently remove anything you don’t want and set every background to transparent.
  4. If you cannot see Save as a Picture, right click on the text box and tell it to close the edit.  If necessary, do this several times until Save as a Picture appears.
  5. Save as a Picture.

2 Use Microsoft Picture Manager to crop and resize

  1. Use Microsoft Picture Manager to open the .png file.
  2. Crop and resize as you need to.
  3. Resave.

Done!  You should have a text logo in .png format with a transparent background.

3 Comments