Coming soon - Get a detailed view of why an account is flagged as spam!
view details
8
[Tutorial] Shell script to SSH over usb
Author Summary
bwesty016 is in Tutorial
Post Body

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.

Author
Account Strength
100%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,832
Link Karma
522
Comment Karma
1,310
Profile updated: 2 days ago
Posts updated: 11 months ago
iPhone 8, iOS 13.1.2

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago