In calabash-android After disale the data/Wifi , I am not able to access the app Errno::ECONNREFUSED: Connection refused - connect(2) for "1 - calabash-android

In calabash-android After disale the data/Wifi , I am not able to access the app
irb(main):003:0> %x(adb shell svc wifi disable)
""
irb(main):004:0> %x(adb shell svc data disable)
""
irb(main):005:0> query("*")
Errno::ECONNREFUSED: Connection refused - connect(2) for "127.0.0.1" port 34777 (127.0.0.1:34777)

adb Can be used over Wi-Fi or over usb :
https://developer.android.com/studio/command-line/adb.html
If you're using it over wi-fi, and disable the connection it will disconnect.
If adb over Wi-Fi is not your case, then we need more info.

Related

SSH not working locally but is working externally after running nmap

I need to be able to SSH into a device on my network. Normally I am able to simply ssh into its local IP address.
I recently ran an nmap scan on it, and now when I try to ssh into its local IP address, I recieve the following:
kex_exchange_identification: read: Connection reset by peer
Connection reset by <IP> port 22
This network is setup in a somewhat unique way. It has one router that manages the Wi-Fi network (what my machine is connected to) which is connected to another box that also acts as the modem. IP addresses that are connected to the Wi-Fi box start with 192.168, whereas those connected to the modem box start with 10.0. The device I am trying to access is connected to the modem box.
Historically, just typing in its 10.0. local address has allowed me to ssh into it with no issue, even though my device is on the 192.168 network, and arp -a does not show it.
Checking the ssh logs of the device via journalctl -fu ssh, I can see that every failed ssh attempt is accompanied by the following message:
Connection reset by 10.0.0.96 port 49949 [preauth]
I do not recognize the IP above, and the port changes every time.
Is this some sort of anti-spam protection that was triggered by my use of nmap? I know it's not just my computer because I am unable to ssh into the device from anything else on my network.
Note that connecting to a VPN then using SSH to connect to the external IP address (which is port-forwarded properly) works, as does connecting via ssh to the machine from the machine itself (127.0.0.1)l
How can I fix this issue?

ssh tunnel VNC server connection closed unexpectedly

I have to tunnel the VNC server(tightvnc-server) running on my local machine to a remote server, so at remote server can access my local machine without port forwarding on router(at local machine network).
Right now I am using the following command
ssh -R 5950:localhost:5900 user#remote.ddns.net
Where 5900 the vnc server port on my local machine. And I have to access the machine from remote server using the command localhost:5950. And when I try to connect using vnc viewer I am getting the error connection closed unexpectedly. Normally if no connection exist I was getting connection refused error. But here something is missing in tunneling. Can any please tell me what could be the reason.
You need to activate the remote desktop, running:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \ -activate -configure -access -on \ -restart -agent -privs -all
Then you can connected using VNC Viewer

VS code ssh trouble for non-22 port

VSCode Version: 1.40.0
Local OS Version: Windows 10
Remote OS Version: CentOS 7
Remote Extension/Connection Type: SSH
Steps to Reproduce:
Use SSH to connect host with non-22 port and declare it in ssh_config, then start connecting
Host refused with error message being "ssh connect ot host XXX.XXX.XX.XX port 22: Connection refused"
I think this message indicates that ssh use port 22 to connect host. But, I have changed it in configure file.

SSH port-forwarding works on one port but not on the other

I am trying this command
ssh username#example -L 27017:10.230.0.6:27017 -L 9201:10.290.0.8:9200 -L 5601:10.210.0.5:5601
The port forwarding works for the 27107 but not the others, do I need to override the ports?
I always get the same error which is:
channel 8: open failed: connect failed: Connection timed out
channel 7: open failed: connect failed: Connection timed out
ssh username#example ... -L 9201:10.290.0.8:9200 -L 5601:10.210.0.5:5601
...
channel 8: open failed: connect failed: Connection timed out
When you connect to port 9201 or 5601 on your local system, that connection is tunneled through your ssh link to the ssh server on the remote ssh server. From there, the ssh server makes a TCP connection to the target of the tunnel--10.290.0.8:9200 or 10.210.0.5:5601--and relays data between the tunneled connection and the connection to target of the tunnel.
The "Connection timed out" error is coming from the remote ssh server when it tries to make the TCP connection to the target of the tunnel. "Connection timed out" means that the ssh server process transmitted a TCP connection request to the target system, and it never received a response.
Common reasons for a connection timeout include:
The target system is down or disconnected from the network.
Some firewall or other network device is blocking traffic between the ssh server and the target system.
The IP address and/or port is incorrect, and the connection attempts are going to the wrong place.

How to connect to remote system using telnet?

I am trying to connect to another windows system using telnet as follows:
1.I open cmd.
2.type "telnet"
3.then type telnet "ip-address of remote system" e.g telnet 15.228.40.25.14
Now when I hit enter get error as:
Could not open connection to the host, on port 23:connect failed
So, please suggest how do i resolve it.
Try to make the telnet connection as
telnet 192.168.10.10 3333
without using :
What you did is correct, but the other computer has to be running a telnet server for you to connect to it on port 23.