ssh tunnel between Visual Studio 2017 and Remote Debugger Msvsmon - ssh

I want to debug an application running on machine2 from a Visual Studio 2017 running on machine1. I can only connect to machine2 via ssh. The ssh connection from machine1 to machine2 works fine.
On machine2, I run Visual Studio 2017 Remote Debugger, port number 4022, "No authentication" and "Allow any user to debug".
Port number might be 4023, since machine2 is a 64 bit windows running a 32 bit application: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2017
But I'm not sure because I don't know how to check if the remote debugger is 32 or 64.
I created an ssh tunnel by running this command on machine1:
ssh -L 4022:localhost:4022 machine2user#machine2IP
(How to create more than one tunnel? is the tunnel both ways?)
On machine1 Visual Studio project settings I set remote debugger to "Remote (no authentication)" and target to localhost:4022.
I can see that in machine2 remote debugger, the machine1user connects. In machine1 visual studio I can see the processes running on machine2.
But when I try to attach to my exe process, I get:
Firewall rules on machine1 allow any ssh traffic and 4022,4023 traffic. Firewall rules on machine2 were automatically set by remote debugger installation.
How can I make Visual Studio on machine1 listen to remote debugger traffic coming from machine2? (I'm guessing that might be the problem).
I already checked similar questions here and none were of help.

I solved it by creating the tunnel with port 4023:
ssh -L 4023:localhost:4023 machine2user#machine2IP

Related

How to connect VS Code to server without RDP

How to connect VS Code to linux server by not login to remote desktop
Current way I login:
open Personal Computer >> Establish VPN connection >> open RDP and login >> open putty/VS code and open SSH connection (linux) write code
Is there a way I can connect VS Code/Putty (Locally installed in PC) to SSH development box without RDP?
example - Local Personal Computer >> Establish VPN connection >> open putty/VS code (locally installed) to establish/connect SSH development server(linux)
When I try SSH from local machine, it always give - time out error.. but with same connection setting (ssh username#servername.companyname.com) if try from remote desktop (work computer) it works fine

Jstatd Remote profiler with jvisualvm

I am trying to profile my web application on my local windows 7 PC visualVM.
I created a jstatd.all.policy file with below code under java's bin directory on my CENTOS 6.8 x86_64 server
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
and tried starting jstatd` with below command
jstatd -J-Djava.security.policy=jstatd.all.policy -p 1099
but when I try profiling on my local PC, I didn't see any process under jvisualvm remote host but just node
i also tried for a test purpose by starting jstatd with same approach on my window server R2 2008 PC and tried to profile with Windows 7 visualVM but still no result just a node with no process but i tried on same windows server pc by adding the remote host for same pc than it shows running processes.
Any suggestions.
Start jstatd by this command:
jstatd -J-Djava.security.policy=jstatd.all.policy -J-Djava.rmi.server.hostname={Your Ip address}

How to debug an Asp.Net Mvc Application in Visual Studio 2012 from a remote computer

I have two computers connected and I have made Remote Desktop Connection from Computer A to Computer B.
I opened Visual Studio 2012 in Computer B , and started debugging Asp.Net MVC Application , it works correctly in browser of local machine and it is also hosted on IIS. But when I open that MVC Application from Computer A's browser , than debuging does not work , i.e. no breakpoints are hit.
I have searched about it , and came across Remote Debugging Monitor , but I am not able to use it.
I need help in this.
If your remote machine is also the IIS server:
If you share your Remote Debugger Folder out so it can be accessed on the remote machine. Folder for 2012 should be
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger
On the remote machine access the folder and run the msvsmon.exe
It will give you a server name once launched. Then on your local machine, in VS2012, in the debug menu, select attach to process.
Enter the server name provided by the remote debugger into the Qualifier field and attach to the w3wp.exe process
if your IIS server is the localhost and your remote machine connects to it:
You dont need remote debugger, just attach to process from the debug menu and select the w3wp.exe process.
For good measure, here is the MSDN

PsExec Windows 8 access denied

I've 8 computers running Windows 8 (the basic edition) and I'm trying to run some application on each of them with a batch script.
I tried:
PsExec.exe -i -d -u USER -p PASSWD \\PCNAME explorer.exe
But it gives me:
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Couldn't access GATE1:
Access is denied.
It works fine on other PCs with Windows 7 Professional.
Does it works just on Pro edition? If so, is there a way I can run something remotely on Win 8?
I resolved the same PsExec "Access is Denied" error on a Windows 8 Pro 64-bit target machine with the following registry modification on the target machine:
Registry Location: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
Add DWORD LocalAccountTokenFilterPolicy
Set LocalAccountTokenFilterPolicy to 1
(Reboot)
In domain based environment, Microsoft PowerShell Remoting may be an alternative to PsExec.
In workgroup setup, especially among many different versions of Windows it may get bit challenging.
PowerShell remoting requires PowerShell 2.0 on both client and server.
Also, ssh with it's all capabilities (including launching remote commands) works under Windows, even free servers (freesshd) and clients (PuTTY family) are available . Downside is requirement for highly privileged account (usually, in some Administrators group) - at least for initial setup.
The GATE1 part in your log is interesting - PsExec requires so called "admin share" enabled (not sure does it work in Windows 8). I'd bet it's not the system, but a network issue.

How to solve sql server remote exe connection issue?

Sql server is installed in remote machine. When i connect that remote sql sever 2005 through code or run exe from my system, its working fine.Exe's are placed in remote machine and the sql sever also exists in that machine. When i try to open that exe from that remote system, i am getting sql server connection error.
The exe worked in windows xp without any issue, facing this issue only in windows 7.
Read an article in microsoft, it asks to add new rule under windows firefall, inbounds and outbounds. Added TPC, UDP port as mentioned.
Tried the below 2 links. Still i am in trouble.
http://www.sevenforums.com/system-security/58817-remote-access-sql-server-express-2008-windows-7-a.html
http://msdn.microsoft.com/en-us/library/ms190181.aspx
Can anybody guide me in this regards.
Is this the default SQL Server instance or have you given it a name? If you have named it, you should access it as ServerName\InstanceName
Is it using port 1433? If so, you must open TCP port 1433 in the firewall. If it is not the default instance it is possibly using dynamic ports which may not be open in your firewall. Also you may need to open the UDP port 1434 so the Browser Service can be accessed (essential if you are using dynamic ports).
Is TCP enabled or are you using the default Shared Memory (you said this worked fine from an XP client so I imagine this is OK).