PHP Developer

My notes and thoughts about Linux, WordPress, PHP and many more.

Edit PHP & HTML files online quickly using Putty SSH Client

The usual and traditional way of editing website files is to download the file first using an FTP client (Filezilla for example). Once the file has been downloaded, it edited in your local computer and then once it is done, it is re-uploaded back to the hosting server using an FTP client and this is a time consuming process.

Therefore the best way is using SSH (secure shell) technology to edit files. One of the best SSH client that will let you edit PHP and HTML files online is pUTTY. SSH technology encrypts the packets as it travels through the Internet and lets you edit files online.

The procedure below requires your website server to support SSH. Please coordinate with your web hosting support to enable SSH, in case you are not familiar. To use Putty SSH to edit PHP and HTML files online:

Step1. Download Putty SSH client here:
This is for Windows OS 32 bit systems. Click putty.exe link as shown in the screenshot. And then download it to your Desktop.
putty download link

Step2. Enter your SSH website information (you can get this from your web host)
Port: 22
Connection type: SSH

Then click “Open”

Step3. In the “Login as:” enter your SSH username, and then enter your password. You cannot see your password as you type it, so enter it carefully. Finally you are logged in when you see the Linux bash prompt:

login as: 291005
Using keyboard-interactive authentication.

Step4. To know the files and directory after you logged in: type ls, it will then give you the list of directories:

-bash-2.06b$ ls
sys/  tmp/  www/

Step5. These are not yet your true website files, most web hosting companies placed these under “www” or “public_html” folder, so to access “www” folder, type cd www in the bash prompt and then type ls again to view the files and directories inside www folder.

-bash-2.05b$ cd www
-bash-2.05b$ ls

Step6. Based on the result above, there are three website folders inside www folder; since this is a shared hosting account. The folders belong to these following websites:


Step7. Supposing you need the index.php file of You need to go inside to that folder first, using cd command, and then type ls to view again the files:

-bash-2.05b$ cd
-bash-2.05b$ ls

Step8. Since index.php is indeed inside folder, you will then launch the editor by typing:

-bash-2.05b$ pico index.php

PICO is a GNU editor. So after pressing enter; you will see the source code of index.php which you can then edit as you like.

Putty PICO editor screenshot

To save changes after editing: Press Control – O and then when you see the message “File name to Write:” press Enter key

To exit the pico editor, Press Control – X
To exit the Putty SSH client: type exit in the bash prompt:

-bash-2.05b$ exit

Not only you can edit PHP and HTML files but these can be used to edit other files also (such as robots.txt or even .htaccess)

Featured image credits: By Logevent - Own work, CC0,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.