This is my first time writing a shell script, but it makes SSH process over USB from a Mac just a little bit faster.
You need a tool called "usbmuxd" to ssh over a usb connection. The easiest way to do this is to install homebrew (Installation instructions are found on their site. It's one command to install, it think) and type: brew install usbmuxd
in a terminal window.
In a terminal window, make a new file called "ssh_connect.command", or something of that sort, just include the ".command" extension to the name:
nano ~/Desktop/ssh_connect.command
Paste the following code:
#!/bin/bash
osascript -e 'tell app "Terminal"
do script "iproxy 2222 22"
end tell'
osascript -e 'tell app Terminal"
do script "ssh root@localhost -p 2222"
end tell'
Do control-x, press "y" and hit enter to save changes.
Set executable permissions: chmod x ~/Desktop/ssh_connect.command
When you open the file you created, it will do everything for you, you'll just have to enter your root password. If you haven't changed it, it will be alpine
by default. I would highly recommend changing this if you haven't already:
Change password for root: passwd
For user: passwd mobile
Again, this is my first time writing a shell script. If you can make it better, then by all means!
Note: I noticed that some SSH over USB tutorials use port 44 as the device port when listening for connections. If you happened to use port 44 to SSH before, then change "22" to "44".
I found that using port 22 after using port 44 gives SSH a hissy-fit saying REMOTE HOST IDENTIFICATION HAS CHANGED!
. This can also be fixed by removing the hostname from the known hosts lists by running: ssh-keygen -R [localhost]:2222
, and then trying to connect again.
Hope this is useful.
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/jailbreak/c...