Advertisement
Home arrow Forums
Welcome, Guest
Please Login or Register.    Lost Password?

[Windows] How to SSH to your iPhone using WinSCP + permissions changing
(1 viewing) (1) Guest
Go to bottomPage: 12345
TOPIC: [Windows] How to SSH to your iPhone using WinSCP + permissions changing
***
#13705
[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 9 Months ago Karma: 153  
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”
m.o.r. (User)
team applei.ph alumni
Posts: 2420
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: California
The administrator has disabled public write access.
 
#15895
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 8 Months ago Karma: 0  
great tutorial. i always SSH but while the iphone is plugged to my pc (via usb). i can't seem to make winscp work via wifi. after reading this tutorial, now i know why.

just wanted to share another thing that you can do, as oppose to changing permissions. i noticed that sometimes when i transfer files from my pc to the iphone, the file's owner changes (eg. from mobile to root) and that is why the result that we expect to happen doesn't happen. so instead of changing the permission, i change the owner instead to it's original value (before i overwrite a file, i check first what owner that file has), and that fixes it.

you change the owner the same way you change permissions, but if the owner field is disabled (grayed out), simply login again using SCP as protocol (as oppose to the default SFTP with SCP fallback) and you'll notice that the owner field is now editable.
the_skrull (User)
Out of the Box
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#16675
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 8 Months ago Karma: 0  
Sorry for the dumb question but how do you use WINSCP while the iPhone is connected via USB?
gwardiya (User)
Out of the Box
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#16683
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 8 Months ago Karma: 97  
gwardiya wrote:
Sorry for the dumb question but how do you use WINSCP while the iPhone is connected via USB?

winscp use only wifi connection. this tutorial does not need iphone cable to connect to winscp.

if you are talking about iPhone Tunnel Suite - New Way to SSH w/no Wifi Needed , its a totally different tutorial.

thanks.
mojacko (User)
mojaaa mojaaa
team applei.ph alumni
Posts: 1415
graphgraph
User Offline Click here to see the profile of this user
ICQ#: 592661943 Gender: Male mojacko@applei.ph Location: State of Qatar Birthdate: 1981-01-01
Peace cannot be kept by force; it can only be achieved by understanding.
The administrator has disabled public write access.
 
#16695
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 8 Months ago Karma: 0  
hi gwardiya, sorry for the confusion there. what i wanted to say was "i always SSH but while...". in my hurry to add something more about winscp, i mixed things up. i'll edit my post to avoid further confusion.

hi mojacko, thanks for the clarification.
the_skrull (User)
Out of the Box
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#16729
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 8 Months ago Karma: 97  
the_skrull wrote:
hi mojacko, thanks for the clarification.

you are always welcome mate.
mojacko (User)
mojaaa mojaaa
team applei.ph alumni
Posts: 1415
graphgraph
User Offline Click here to see the profile of this user
ICQ#: 592661943 Gender: Male mojacko@applei.ph Location: State of Qatar Birthdate: 1981-01-01
Peace cannot be kept by force; it can only be achieved by understanding.
The administrator has disabled public write access.
 
#19396
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 7 Months ago Karma: 0  
Sir, do you have to jailbreak the phone first to ba able to use this, or does it work with out-of-the-box phones as well? Thanks in advance
Need4Speed (User)
applei Newbie
Posts: 27
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Fairview Birthdate: 1967-10-06
The administrator has disabled public write access.
 
#19400
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 7 Months ago Karma: 111  
Hi N4S, yes, you do have to jailbreak it since you need to have OpenSSH for WinSCP to search your iPhone files.

Need4Speed wrote:
Sir, do you have to jailbreak the phone first to ba able to use this, or does it work with out-of-the-box phones as well? Thanks in advance
SithStrife (User)
Siths are KARMA LOVERS!
applei Citizen
Posts: 1012
graphgraph
User Offline Click here to see the profile of this user
Gender: Male jinnfernando hikaima SithStrife Location: Baguio City Birthdate: 1987-05-07
"I'm unequivocally ravenous!"

White iPhone 4 16GB iOS 5
13" Macbook Pro 8,1 | 2.3 GHz i5 | 4GB RAM | 320GB HDD | OS X 10.7.1
The administrator has disabled public write access.
 
#19403
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 7 Months ago Karma: 0  
Thanks Sir SithStrife Sorry if this sounds like a newbie question, butI read somewhere here about something called ifunbox which offers the same file-browsing capabilities without the need to jailbreak, is this correct? Whats the difference between that and WinSCP? Thanks in advance
Need4Speed (User)
applei Newbie
Posts: 27
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Fairview Birthdate: 1967-10-06
The administrator has disabled public write access.
 
#19404
Re:[Windows] How to SSH to your iPhone using WinSCP + permissions changing 3 Years, 7 Months ago Karma: 111  
Yes, iFunbox is the same with WinSCP in terms of phone browsing, but iFunbox can't change permissions. But, it's still the same. It's your decision what to use.

Need4Speed wrote:
Thanks Sir SithStrife Sorry if this sounds like a newbie question, butI read somewhere here about something called ifunbox which offers the same file-browsing capabilities without the need to jailbreak, is this correct? Whats the difference between that and WinSCP? Thanks in advance
SithStrife (User)
Siths are KARMA LOVERS!
applei Citizen
Posts: 1012
graphgraph
User Offline Click here to see the profile of this user
Gender: Male jinnfernando hikaima SithStrife Location: Baguio City Birthdate: 1987-05-07
"I'm unequivocally ravenous!"

White iPhone 4 16GB iOS 5
13" Macbook Pro 8,1 | 2.3 GHz i5 | 4GB RAM | 320GB HDD | OS X 10.7.1
The administrator has disabled public write access.
 
Go to topPage: 12345
Moderators: Jokwang  applei.ph  ims  ranns  clayartist  conan15  justinred 
Advertisement

Login

Who's Online

Who's on applei.ph now!
Guests: 53
Members: 34
Advertisement
Advertisement

applei.ph facebook group   Follow applei.ph on Twitter for iPhone Updates!