Putty File Transfer Commands in SSH Protocol - Browsing web server files using Putty
(Page 2 of 4 )
Once SSH is enabled, you can start using Putty for any SSH connection to your server. One of the things you need to know when transferring files using a command line (as opposed to using GUI FTP client) is the file path. This can be discovered by browsing web server files and executing SSH commands to tell you the path.
The SSH/secure shell commands are based on the Linux and UNIX environments, and with the use of the Putty SSH client, you communicate with an SSH server and issue secure shell commands in a Windows working environment.
Step 2: Double click the application icon and choose to run it.
Step 3: Under “Host name (or IP address)” enter the IP address of your web server.
Step 4: Under “Port,” enter 22.
Step 5: Under connection type, check “SSH.” Leave the others at the default settings.
Step 6: Click “Open.”
Step 7: If a certificate security warning pops up, click “yes.”
Step 8: Under “Login as:” enter your FTP username, and then, after you enter it, enter the password as well. For security reasons, you will not see the password as you type, so make sure to type it carefully.
Putty command line example:
login as: codexm
codexm@82.197.130.134's password:
Step 9: If no errors are shown, you have successfully connected to your website/SSH server using Putty. To learn the name of the existing directory after logging in, enter this command: pwd
Putty command line example:
[codexm@p424545ds ~]$ pwd
/home/codexm
Step 10: To know the list of files under the directory you are currently browsing, enter: ls
Note: The directory you are currently logged into may not be the website's public HTML root directory, for example under this list of directory files/folders:
Putty command line example:
[codexm@p424545ds ~]$ ls
data htconfig html
Website files are actually saved and stored in an HTML folder.
Step 11: Now to browse the files under the HTML folder, use the cd command and then type the ls command again:
Putty command line example:
[codexm@p424545ds ~]$ cd html
[codexm@p424545ds html]$ ls
(It then shows a long list of your website files and folder stored in the public HTML root directory; a sample list is shown below)
wp-admin
wp-app.php
wp-atom.php
wp-blog-header.php
wp-comments-post.php
wp-commentsrss2.php
wp-config.php
wp-content
wp-cron.php
wp-feed.php
In addition, you CANNOT see the server configuration files like .htaccess by using the ls command. In this case you will use the ls –a command:
Putty command line example:
[codexm@p424545ds html]$ ls -a
.hcc.thumbs
.htaccess
An example list of configuration related files shown above.
Step 12: If you would like to browse the content of the wp-content folder, simply enter:
Putty command line example:
[codexm@p424545ds html]$ cd wp-content
[codexm@p424545ds wp-content]$
Step 13: If you would like to go up one level higher, this means going back to the root directory. Enter the cd .. command