this is a really easy & quick guide to using WinSCP to SSH into your iPhone/iPodTouch. countless firmwares and other desktop software had already been released yet the SSH method remains to be the best way to tinker with your iphone/ipodtouch's file system. (Ranma has illustrated a great & comprehensive tutorial for using SSH+WinSCP to install appsupport fixes for windows.) this guide, on the other hand, aims to illustrate a general WinSCP guide by itself.
to the new users, using SSH to transfer/change permissions may seem a daunting task yet in reality, it is as simple as drag-and-drop!

(a few screenshots courtesy of Ranma's appsupport tutorial thread)
How to SSH using WinSCP
requirements:
- download WinSCP from
the official site to ensure you have the latest version.
* the "installation package" installs the software to your desktop.
* the "portable executable" does not install the software. clicking on its .exe simply runs WinSCP w/out need for installation to the desktop. (very handy for those who like bringing portable apps in a flash drive)
- OpenSSH (for cydia) or OpenSSH+BSD Subsystem (for installer app), and Bossprefs or SBSettings (to toggle SSH on/off) must be installed on your iphone or ipodtouch.
- wifi connection.
Instructions:
1) on your iphone, launch the Settings app and turn on Wifi. tap the blue arrow next to your connected network's name and take note of your iphone's IP Address.
2) while in the Settings app, change your Autolock settings to "Never". this is due to the fact that the iphone's network connection is automatically switched off when the iphone goes to sleep mode.
* alternatively, if you have Insomnia app installed, just switch insomnia to on in order to leave your network connection turned on during the iphone's sleep mode)
3) launch Bossprefs app or SBSettings drop-down window and toggle SSH to "On".
* you can also view your iphone's IP when you turn on wifi using Bossprefs.
4) launch winscp on your desktop & type the following info into the appropriate fields:
Host Name: (type your iphone's IP address here - usual format is 192.168.X.X)
User Name: root
Password : alpine
Tip: clicking "Save" will save that IP address into winscp so one does not need to re-type everything if the IP remains the same on the next session.
- there will be a pop-up window warning you that you are about to store a session with a filled password. simply click "OK"
- a 2nd pop-up will ask you for a save name. i recommend using the IP address as the name.
* only for the iphone 3GS, you will need to change the File Protocol to SCP. by default, it is set to SFTP as per the screenshot above. change it by clicking the arrow next to it and select SCP. for the 1st gen iphones and the iphone 3G, you don't need to do this added step.
5) after filling-in the host name/user/password fields, click "Login".
* if this is the first time you will SSH into the iphone unit (ex. after a fresh restore), you won't be able to get through and this window will pop-up.
please do not click "abort" and just leave it at that window for about a minute or so until another warning pop-up similar the ones below appear. simply click "YES" to continue logging into your iphone.

or this
* during first-time login after a restore, it may take a few more tries in order to get through so just simply retry again and again till it completes the cache key log generation into your iphone and completes the logs-in.
6) once you get through, the main winscp window looks like this:
the left window shows your desktop's files and the right window shows your iphone's file directory. the right directory opens by default to /private/var/root/. all recent firmwares' files are in /private/var/mobile.
congratulations! now you are ready to do file transfers to and from your iphone!
notes:
7) you can drag and drop files to and from your iphone on the right window. (i personally don't use the left window anymore since i drag-and-drop the files) just make sure if you're dragging a file/folder into the right window that the mouse pointer is on an empty space in the right window before you let go of the mouse button to drop the file/folder. this is because it works like file explorer in the sense that if you dropped it into another folder in the right window and not on an empty space, the files you're transferring will be dropped inside that other folder and not on your desired location.
8) in order to change a file's permissions on your iphone:
- simply right-click on the file
- select "properties" and this window will pop-up

- type in your desired file permission on the field named "Octal" whether it's 0755 or 0777 depending on the type of file and instructions you are following about its permissions.
9) if WinSCP asks for Putty for terminal access, download from this
direct link and put the putty.exe file into your winscp install directory folder.
10) if you are having errors after restoring or updating the firmware on your iphone & while using WinSCP and trying to access the Applications folder :
“Error listing directory ‘/private/var/stash/Applications.XXXXXX’
No such file or directory.
Error code: 2
Error message from server: No such file
Request code: 11″
the fix would simply be clearing the cache in WinSCP.

click “Commands” then “Clear Caches”