here's what I'm trying to do: build GUI program using PyQt4 to make testing connection between 2 computers easier (to minimize human errors). So, part of this program is to use QProcess to begins the iperf3, acting as either client or server. QProcess was able to begin iperf3 successfully and output the results, however, for some reason, iperf3 client in PyQt cannot connect to server despite the fact that I was able to connect to the server from the terminal.
Here's brief description of situation and combinations of which acts as server and client
iperf3 in terminal as client -> iperf3 in PyQt as server - success
iperf3 in terminal as client -> iperf3 in terminal as server - success
iperf3 in PyQt as client -> iperf3 in PyQt as server - unable to connect
iperf3 in PyQt as client -> iperf3 in terminal as server - unable to connect
I checked on firewall and I disabled it to see if it resolves the issue, it didn't. Just in case if you're wondering about what commands I used for iperf3 in terminal, here is it:
Client - iperf3 -c 127.0.0.1 -u -t 10
Server - iperf3 -s
As for the QProcess:
self.process.start('iperf3',['-c 127.0.0.1 -u -t 10'])
self.process.start('iperf3',['-s'])
If you need more information, please let me know. I appreciate any help / insight with this issue. Btw, I should mention I'm testing this program on laptop locally for now, thus the loopback address.
Okay, I figured it out. The mistake was in the code for QProcess, which is
self.process.start('iperf3',['-c 127.0.0.1 -u -t 10'])
It should have been
self.process.start('iperf3',['-c','127.0.0.1','-u','-t','10'])
Related
I need some help with a really strange problem.
I use wget (busybox) to obtain the the IP address of some remote clients, to use it on a DNS (a sort of "homemade ddns"). Those clients run a script that every 5 mins calls
wget -O /dev/null "https://my_dns.org/poll.php?user=User_N&pwd=password_N"
Everything was fine, until I updated my http server to remove TLS1.0/TLS1.1
After updating: running the above command on the clients' console it still works OK, while running it automatically (launching it from a script in /etc/init.d) I get this error:
Connecting to my_dns.org (www.xxx.yyy.zzz:443)
wget: error getting response: Connection reset by peer
...Any idea about why does this happen, and how to fix...?
(The shell on the clients runs as root...)
Thank you in advance for your help
Regards
I recently moved to a different country, but I work remotely and therefore I thought that my workspace wouldn't be interrupted. However, now that I'm trying to connect to my workspace through ssh in vscode, the connection keeps disconnecting. I connect to the workspace through the VPN my workspace provides, and while I can connect to the linux box I work in via ssh, I cannot connect to it through vscode-remote-ssh extension like I did for the past few months. Nothing has changed in terms of settings on my computer. I attached the output vscode provides when I tried to connect below (this is the output from the reconnection attempt but the first connection attempt looks exactly the same).
[15:36:11.086] ------
[15:36:11.086] SSH Resolver called for "ssh-remote+203.0.113.0", attempt 2, (Reconnection)
[15:36:11.087] SSH Resolver called for host: 203.0.113.0
[15:36:11.087] Setting up SSH remote "203.0.113.0"
[15:36:11.091] Using commit id "e5e9e69aed6e1984f7499b7af85b3d05f9a6883a" and quality "stable" for server
[15:36:11.092] Install and start server if needed
[15:36:11.096] Using SSH config file "C:\Users\windowsUser\.ssh\config"
[15:36:11.096] Running script with connection command: ssh -T -D 53043 -F "C:\Users\windowsUser\.ssh\config" 203.0.113.0 bash
[15:36:11.101] Terminal shell path: C:\Windows\System32\cmd.exe
[15:36:11.240] >
[15:36:11.240] Got some output, clearing connection timeout
[15:36:13.669] > linuxUser#203.0.113.0's password:
[15:36:13.670] Showing password prompt
[15:36:29.329] Got password response
[15:36:29.330] "install" wrote data to terminal: "*******"
[15:36:29.358] >
>
[15:36:31.047] > 3a294560e95d: running
> Acquiring lock on /home/linuxUser/.vscode-server/bin/e5e9e69aed6e1984f7499b7af85b3
> d05f9a6883a/vscode-remote-lock.linuxUser.e5e9e69aed6e1984f7499b7af85b3d05f9a6883a
>
[15:36:31.073] > Found existing installation at /home/linuxUser/.vscode-server/bin/e5e9e69aed6e1984
> f7499b7af85b3d05f9a6883a...
> Found running server...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Checking server status on port 34103 with wget
>
[15:36:31.108] > 3a294560e95d: start
>
[15:36:31.391] > sshAuthSock====
> listeningOn==34103==
> osReleaseId==ubuntu==
> arch==x86_64==
> webUiAccessToken====
> tmpDir==/run/user/1000==
> platform==linux==
> 3a294560e95d: end
>
[15:36:31.391] Received install output:
sshAuthSock====
listeningOn==34103==
osReleaseId==ubuntu==
arch==x86_64==
webUiAccessToken====
tmpDir==/run/user/1000==
platform==linux==
[15:36:31.392] Remote server is listening on 34103
[15:36:31.392] Parsed server configuration: {"remoteListeningOn":{"port":34103},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/run/user/1000","platform":"linux"}
[15:36:31.393] Starting forwarding server. localPort 53048 -> socksPort 53043 -> remotePort 34103
[15:36:31.395] Forwarding server listening on 53048
[15:36:31.395] Waiting for ssh tunnel to be ready
[15:36:31.396] Tunneled 34103 to local port 53048
[15:36:31.396] Resolved "ssh-remote+203.0.113.0" to "127.0.0.1:53048"
[15:36:31.397] [Forwarding server 53048] Got connection 0
[15:36:31.402] ------
[15:36:31.430] [Forwarding server 53048] Got connection 1
[15:36:31.431] [Forwarding server 53048] Got connection 2
The connection hangs on [Forwarding server 53048] Got connection 2 for a few seconds before disconnecting me and repeating this message (and asking for password again). I tried removing the .vscode-server file from the linux computer, which is then recreated right away but it still doesn't let me connect. I also tried changing the timeout in the vscode settings but this also did nothing. I am unsure why this would happen after simply physically moving the computer from one place to another but remaining on the same vpn, and why I would still be able to connect with regular ssh but just not through the vscode-remote ssh extension.
You might try ssh manually to the server and delete the remote server folder which makes VSCode download it again from scratch.
This has helped me today:
rm -rf ~/.vscode-server/
rm -rf ~/.vscode-remote/
The suggestion comes from the following discussion: https://github.com/microsoft/vscode-remote-release/issues/2513
You might also wanna check if your new network IP is allowed in the target group of the server.
I had the same exact issue, and for me.
I dont have a resolution but a crappy workaround - reboot the far machine.
im running ubuntu 20.04 and once i rebooted, then i can connect from visual studio and connection stays up, BUT once i close the VSC and restart, then i see this issue again, and again i have to reboot the far machine.
EDIT: later i discovered that stopping the sshd daemon with systemctl start/stop sshd also helps this situation - so no need to reboot
This issue is due to a hard coded 20 second timeout in the protocol between the vscode client and the remote server. This is discussed in detail here: https://github.com/microsoft/vscode-remote-release/issues/7497. No fixes for this yet and will hopefully be fixed soon by making this timeout configurable (to allow overcoming these disconnects).
Remote SSH plugin states VS Code Insiders has experimental support for Windows 10/Server 1803+ using the official OpenSSH server.
I have the official OpenSSH server installed and configured on Windows Server 2019 1809. I can connect via pubkey authentication and have PowerShell Core over ssh working as well. I tried both Remote SSH and Remote SSH nightly plugin. At first it was complaining that it couldn't find bash. So I installed git bash and added it to the system path. I get the following error when attempting to connect to my windows server:
[16:02:41.398] Log Level: 3
[16:02:41.399] remote-ssh-nightly#2019.12.24000
[16:02:41.399] darwin x64
[16:02:41.401] SSH Resolver called for "ssh-remote+myserver", attempt 1
[16:02:41.401] SSH Resolver called for host: myserver
[16:02:41.401] Setting up SSH remote "myserver"
[16:02:41.413] Using commit id "e74405d11443c5361c31e2bc341866d146eee206" and quality "insider" for server
[16:02:41.414] Testing ssh with ssh -V
[16:02:41.425] ssh exited with code: 0
[16:02:41.425] Got stderr from ssh: OpenSSH_7.9p1, LibreSSL 2.7.3
[16:02:41.430] Running script with connection command: ssh -T -D 51951 -o ConnectTimeout=15 myserver bash
[16:02:41.430] Install and start server if needed
[16:02:43.451] > 5122b1a5b835: running
> Unsupported architecture: MINGW64_NT-10.0-17763 x86_64
> 5122b1a5b835##27##
[16:02:43.452] Got some output, clearing connection timeout
[16:02:43.710] "install" terminal command done
[16:02:43.710] Install terminal quit with output: 5122b1a5b835##27##
[16:02:43.710] Received install output: 5122b1a5b835##27##
[16:02:43.710] Unsupported architecture
[16:02:43.711] Resolver error: The remote host's architecture is not supported
[16:02:43.714] ------
Anybody know the magic sauce to get Remote SSH working w/ Windows 10/Server?
Looks like VSCode is attempting to run bash on the server which I'm guessing would resolve to git's bash which is mingw based as I recall. VSCode should be running Powershell on the server.
Did you include your server in the list of windows remotes in the extension's settings?
Requires "remote.SSH.windowsRemotes" setting. Here is the documentation.
"remote.SSH.windowsRemotes": ["myserver"]
I have recently discovered vscode and the remote development extension, and wanting to try it out, but I can't get the damn thing to connect to my development server.
I've installed the both the vscode and vscode insiders packages by downloading the .deb packages manually on my local machine and installed the extension it self by executing this line:
ext install ms-vscode-remote.vscode-remote-extensionpack
Afterwards my pre-configured ssh hosts gets discovered fine and i have key-based auth running and it works fine when connecting to the server from a terminal.
But when I try to connect to the server, by right clicking and selecting one of the two options, only a notification saying "Confirming hostname is reachable" pops up for a second or two and then nothing else happens.
There are no information in the "output" view, other than this line:
remote-ssh#0.42.2
I've checked and confirmed the remote server has the needed prerequisites.
Also i see nothing in the /var/log/audit/audit.log on the remote server when trying to connect, so I dont even think it tries to establish a connection.
What am I missing ?
Local OS: Linux Mint 19 Tara
Remote OS: CentOS 7
I found the issue - "+" signs makes the extension fail: https://github.com/microsoft/vscode-remote-release/issues/612
I have this line in my local .ssh/config
Host *+*
ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') nc -q0 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
Which allows me to connect to host b through host a like so:
ssh hosta+hostb
Removing that fixed the issue, and I connect succesfully to a remote host - it simple seems that that vscode dislikes that line.
I face a problem that I can ping to correct IP address, it have no loss. And also I use nmap ping the pi address, and I get it correctly. Then I using VNC viewer to try access to pi, but it always show up "The connection was refused by the host computer"
Did u all have any idea ?
Your problem indicates that your Raspberry Pi was reached by the connection attempt, but that no service was running on the relevant port and hence the connection was refused. I think, this is because the VNC service is not running on your Raspberry Pi.
Update 1
Raspbian now comes with the server by default thanks to a partnership with RealVNC, it just needs to be enabled.
Original
You must enable VNC Server on your Raspberry Pi using terminal
sudo apt-get update
sudo apt-get install realvnc-vnc-server
or you can also enable VNC Server on the command line using the sudo raspi-config command.
Advanced Options->VNC:Yes
Now you can connect to the VNC Server using a application such as VNC Viewer.
I have been having this issue with my Raspberry Pi Zero W even though it worked perfectly beforehand. This page https://www.realvnc.com/en/connect/docs/raspberry-pi.html should help.
I ran vncserver in a ssh window after verifying the interface settings in raspi-config.
It started the VNC Server and gave me the VNC Server catchphrase and the IP address with Port Number as shown in the photo linked below.
vncserver output
After running that command I was able to get the VNC Viewer on my windows machine to connect to the pi.
I then ran sudo systemctl enable vncserver-x11-serviced.service in the ssh window so that it would start automatically on subsequent reboots.
I've had this same problem but found a different reason. I found three ways to get around this error message.
Plug a mouse or keyboard into the Raspberry Pi zero, waking up the screen and the VNC connection.
Wait about 5 - 10 minutes which is the amount of time for the screen saver to kick in which seems to wake up VNC connection. but don't wait to long other wise run this command to get things going via ssh "systemctl start vncserver-x11-serviced.service".
I am hoping the new update they just published will fix this problem. I don't see this as much with the Raspi B3+ as with the Zero H.
The last was plug in both monitor and mouse and that for sure fixes the VNC issues but defeats the headless connection. It seems that running headless and the screen/saver are somehow related but just not smart enough to figure it out.
For people using newer version of Raspberry, VNC option is found under:
Config>Interface Options
pinging to any service will only tells us that whether the server is currently listening on that port or not. It will not tell you the possible result to connection request asked by client.
It seems that, you have installed VNC server but not started it properly. Use this command to start it...
# vncserver start
Also recheck the port number is correct or not.
With the Rasp Pi 4 - had connecting fail after rebooting both the server and client (both Rasp Pi 4s).
Took a while to realize that I have two clients: One named "VNC Client", the other "VNC Viewer for Google Chrome".
The former works, the latter doesn't.