SSH to remote Mac that is connected to iPhone hotspot - iphone

I am trying to SSH into my wife's Mac from my Mac. Her computer is connected to to her iPhone Wi-Fi hotspot. My SSH request times out every time.
I had her go to Systemprefs → Sharing, then check remote login and tell me the address to SSH.
I had her turn off her firewall under Systemprefs → Security as well.
Is this a firewall issue? Am I missing something simple?

So this a classic SSH/Connect behind a router or a private network.
In your case since it is a iPhone tethering which is a least configurable router, where you can't achieve what you want.
Next option is connecting behind a private network
Mac ---> iPhone ---> Internet <--- Mac
Now this only work if your Mac is reachable from the other Mac
---------------------- ----------
↑ ↓ ⟶ ↑ ↓
Mac ---> iPhone ---> Internet <--- Mac
So below are the pre-conditions for this to work
Both Mac have SSH enabled
Your Mac has an IP Y.Y.Y.Y and is reachable by Mac behind the iPhone tethering
First the Mac behind iPhone will open a Reverse tunnel to your Mac using below
sudo ssh -R 4455:127.0.0.1:22 <yourmacuser>#Y.Y.Y.Y
Once this connection is made you can test on your Mac the port being available like below
$ telnet localhost 4455
Trying ::1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.6
Once the tunnel is open you can then ssh back to the other Mac
$ ssh -p 4455 <othermacuser>#localhost

The public IP address in question is the iPhone's IP, not the hotspot client's IP. The cient IP is on a network like 172.20.10.1 and is unreachable via the public Internet.
Because the iPhone isn't configured to forward traffic to clients, to my knowledge you can't use the iPhone as a jump box using a standard iOS build.

Go to terminal on your Mac.
Type in:
ssh "username"#"ip address"
The username is the one that is your wife's computer login name and the ip address is the local address of your wife's computer.
It'll then prompt you to enter the password for access.

Related

Possible to make vscode use a proxy upstream of remote-ssh?

question:
Is there any way to tunnel all outgoing ssh connections in vscode (including those established by the remote-ssh plugin) through my on-site workstation? I have full control over the firewall for that machine and can open ports on ufw as needed for off-site access.
background:
I use vscode remote-ssh to connect to a research computing cluster when on-site.
For remote work, I would like to avoid using cisco anyconnect as a vpn in mac os 11.6, as routing and other os features behave unexpectedly.
Turns out in mac os, it's sufficient to edit the ~/.ssh/config file by specifying an on-site proxy host that I control within the ProxyCommand option:
Host clusterNode
ProxyCommand ssh me#my_accessible_ssh_host nc %h %p
HostName <firewalled node ip address>
User my_cluster_username

Q: How to run flutter app on device without usb or connecting to computer

Is it possibly to run flutter app on device without connecting to computer, something like expo for Flutter?
assuming that you're using an Android device, it should be possible if you pre-connect the device to the computer wirelessly after some initial setup provided here: https://developer.android.com/studio/command-line/adb#wireless
You can use adb wifi plugin. Or else you can use these commands(Which is mentioned in here). You can write a *.bat file with these commands.
adb tcpip 5555
adb connect xxx.xxx.xxx.xxx:5555 // IP address of your device xxx.xxx.xxx.xxx:5555
echo finished - unplug USB connection
pause
Note: This is only for Android devices
For Android:
Connect your Android device and adb host computer to a common Wi-Fi
network accessible to both. Beware that not all access points are
suitable; you might need to use an access point whose firewall is
configured properly to support adb.
If you are connecting to a Wear OS device, turn off Bluetooth on the
phone that's paired with the device.
Connect the device to the host computer with a USB cable.
Set the target device to listen for a TCP/IP connection on port 5555.
adb tcpip 5555
Disconnect the USB cable from the target device.
Find the IP address of the Android device. For example, on a Nexus
device, you can find the IP address at Settings > About tablet (or
About phone) > Status > IP address. Or, on a Wear OS device, you can
find the IP address at Settings > Wi-Fi Settings > Advanced > IP
address.
Connect to the device by its IP address.
adb connect device_ip_address
Confirm that your host computer is connected to the target device:
$ adb devices
List of devices attached
device_ip_address:5555 device
You're now good to go!
If the adb connection is ever lost:
Make sure that your host is still connected to the same Wi-Fi
network your Android device is.
Reconnect by executing the adb connect step again.
Or if that doesn't work, reset your adb host:
adb kill-server
Then start over from the beginning.
Source of information.
If you don't want to do all these steps manually then you can use this plugin in Android Studio:
https://plugins.jetbrains.com/plugin/7856-adb-wifi/
See also:
https://android.jlelse.eu/connect-android-device-with-wifi-within-android-studio-3b1bc00c1e17
For android device only, on a linux type OS.
adb tcpip 5555 && adb connect 192.168.***.***
unplug your device and you're good to run.

Putty gives "Network Error: Connection time out" while connecting to raspberry pi 3 using router in windows

I am using D'link rouer DSL-2750U. I have installed raspbian jessie in Rpi 3 and connected it to router. Connected my laptop to router wifi. But when i try to connect putty using the IP address of raspberrypi which i have got from router admin panel it gives connection time out error. Also i have tried to adjust keepalive seconds in putty connection setting and enabled X11 forwarding.
I recommend you to check if ssh is enabled in your device:
sudo raspi-config
then navigate to ssh, hit Enter and select Enable or disable ssh server. Now reboot raspberry and try again.
Please Open you RaspberryPI terminal and run the command "sudo service ssh restart". Try connect again from putty
For everyone who is getting a network error from Putty even all of their network settings are okay, you just follow a single step:
Just go there in Connection and set the time for 10 sec or more.

Authentication by identity file failed with error code -18

I received this error when trying to establish an SSH tunnel using pgAdmin3
I specified the private key location on my local machine (had to
enable hidden files on my Mac finder to see it),
entered the tunnel
host (used public host IP) and
checked the 'Identity file' option.
I don't have a password set on my key.
Received this error:
Authentication by identify file failed with error code -18
What am I doing wrong (or what do I need to do differently)?
I was getting this continously on windows (VM).
So I decided pgAdmin's built in ssh tunnel was no good and just used gSTM (On linux).
Forwarding the port from the remote server 5432 to local host 5555 worked.
Then I could just use pgAdmin III on Linux to connect.
You could probably use command line like this if you don't want to use a graphical tool such as gSTM.
ssh -fNg -L 5555:localhost:5432 {your_username}#{yourdomain.com}
Source: http://dustindavis.me/ssh-tunnel-in-pgadmin3-for-postgresql/
You can also use putty on windows to forward ports.
See Connection | SSH | Tunnels menu in the PuTTY Configuration.
http://www.akadia.com/services/ssh_putty.html
Then you can access it.
Of course be very carefull messing about in a remote database.
It is a good idea to label them a red or orange colour in pgAdmin to easily identify the ones that are not on your local network.

Netcat anomaly in VMWare/Cygwin/Sockets environment

I'm happily running Ubuntu Linux in a VMWare box hosted on XP.
My Linux application opens up your basic server socket port, to which I connect netcat (nc) as a client to listen in on the traffic I'm putting on that socket for the "real" clients. All's well.
However, when I open up a Cygwin shell on the XP side and run nc from there it appears to be unable to connect to my application's server socket.
To verify connectivity, though, if I run nc as a server (nc -l -p 3694) in the Linux/VMWare environment, nc on Cygwin has no trouble connecting to it and transferring data back and forth (the IP address is not localhost, it's the one assigned by DHCP).
To summarize:
Linux App -- Linux nc : Works
Linux App -- Cygwin nc : Does not work
Linux nc (svr) -- Cygwin nc : Works
Which netcat code are you using? At least one variant has known issues...
Is it possible you have the guest network set to NAT and therefore things can't connect to something listening in the VM?