First thing first before SSH your iPhone, jailbreak your iPhone first: jailbreak using Corona, Corona 2, and Redsn0w and don't forget to make your device under wireless network in order to acquire its IP ADDRESS. Go and then activate the Wi-Fi first.
And now we are going to use an open source namely Cyberduck -- download it for Mac and if your machine running on Windows, there is a beta version for you -- here for Windows.
1. Once you are ready, go to Cydia.app and search OpenSSH, then install it.
2. Now launch Cyberduck you downloaded earlier and hit on 'Open Connection' button.
3. Now it is time to enter the IP Address of your iPhone. Don't know where to find your IP? Go to settings.app, and choose Wi-Fi. You will see your IP address when you choose the blue arrow.
4. Choose SFTP option from the dropdown menu to enter username and password. For username, type : root and as for Password, type: alpine. And then hit Connect.
5. If you see the Unknown Host message appears, worry not, ignore it and continue your step by clicking Allow.
Now you can SSH into your iPhone for further need:).