Vs code remote Ssh Connection issue - c#

I have been using VS Code and connecting remotely from home on my company computer to our Centos System via using SmarTTy. But I want to use VS code Remote SSH instead of SmarTTy due to the fact that SmarTTy doesn't have a good UI and I think it's obsolete. I faced some problems when I have created connection. I am sharing my conf. file
Host app-ff
HostName app-ff
User cayhan
IdentityFile C:\Users\cayhan\.ssh\id_rsa
I click 'Connect to Host Current Window' and ask me operating system (linux,windows,macos) and after that ask me password. Although everything is correct I can't access it with VSCode and get error 'Could not establish connection . Permission denied'
How can I solve this problem

Windows has CLI ssh client now. You can open terminal in VS code and use
ssh -i id_rsa username#IP

Related

how to connect to remote mac with xamarin/visual studio?

Just installed Visual Studio Enterprise 2017, hoping to use Xamarin to develop iOS apps, which I have abandoned in the past due to connection issues with Xamarin.
No matter what I do, Xamarin will not reliably connect to the Mac on the network. It did connect once but, suspecting my old Mac is too slow to avoid timeout issues with Xamarin, I rented a cloud Mac from MacInCloud.com. Xamarin still won't connect to the remote, even though I can SSH to it via Putty.
Does anyone have a system that works reliably, or know of a good way to troubleshoot this? Xamarin error reporting and logging does not seem to help in any way.
Take a look at this example in xamarin developer page :
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/
Windows Setup
Make sure to install Xamarin tools on your Windows machine.
Connecting
There are two ways to connect to the Mac build host:
On the iOS toolbar:
Or by browsing to Tools > Options in Visual Studio, selecting Xamarin > iOS Settings and clicking the Find Xamarin Mac Agent button:
Navigating either way will lead to the Mac Agent dialog, illustrated below:
This will display a list of all the machines that have either been previously connected and are stored as known machines, or machines that are available for Remote Login.
Select a Mac by double-clicking on it to connect to it. The first time that you connect to a Mac, you will be prompted to enter your Mac user credentials (which must be an Administrator account) to allow the remote connection:
The agent will use these credentials to create a new SSH connection to the Mac. If it succeeds, an SSH key will be created, and will be registered in the authorized_keys file on that Mac. On subsequent connections the agent will use the username and key file to connect to the most recently connected known build host.
Note: You must use the username and not the full name when entering your credentials. You can find this out by using the whoami command in Terminal. For example, from the screenshot below, the account name will be amyb and not Amy Burns:
When a connection has been successfully made, it will display in the Host Selection dialog with a connected icon next to it, as illustrated below:
There can only be one connected Mac at any one time.
Each machine in the list, whether connected or otherwise, will display a context menu on right-click, allowing you to Connect, Disconnect, or Forget the Mac as needed:
If you choose to Forget this Mac, you will need to re-enter your credentials to connect to it again.
Manually adding a Mac
In certain circumstances, you may wish to manually add a Mac if you cannot see its mDNS name listed in the Host Selection dialog. To do this, follow the steps below:
Locate your Mac’s IP address by either browsing to the System Preferences > Sharing > Remote Login on your Mac:
Or, if you prefer to use the command line you can find out your IP address by entering ipconfig getifaddr en0 into Terminal (Note that depending on the type of connection the variable might be en1, en2 etc.):
Return to Visual Studio and in the Host Selection dialog, select Add Mac...:
Enter the IP address of you Mac into the Add Mac dialog and click Add:
Finally, enter the username (not full name) of your Mac admin account and the corresponding password:
Once you click Login, Visual Studio will log into the Mac machine using SSH and will add this Mac as a known machine.
Command Line Support
The new agent also supports building a Xamarin.iOS configuration from the command line. To use it, you will need to pass the following required parameters to MSBuild:
ServerAddress – The IP address of the Mac server.
ServerUser – The Username (not Full Name) to be used to log in to the Mac Server.
ServerPassword – The Password used to log in to the Mac host (optional).
The ServerPassword parameter is not required.
Instead, the first time a password has been passed, either by using Visual Studio or the Command Line, for that particular Windows, Mac, and user configuration a key pair will be generated and stored on the Windows machine for future use. It will be located in %localappdata%\Xamarin\MonoTouch\id_rsa. If you do not pass the ServerPassword parameter, the id_rsa keyfile will be used for authenticating.
An example command to connect to Mac 10.211.55.2 using xamUser account with password mypassword is shown below:
C:\samples\App1>msbuild App1.sln /p:ServerAddress=10.211.55.2 /p:ServerUser=xamUser /p:Platform=iPhoneSimulator /p:ServerPassword=mypassword
Have had same problem since I upgraded to VS 2017. Two things happened just now:
Upgraded my Macincloud MacOS to Sierra. Still couldn't connect.
Noticed an Update to VS 2017. Installed it.
Now I can connect the Mac Agent and run simulations on the Mac.

Trouble publishing using clickonce to ftp server running filezilla

I'm trying to publish a C# application using ClickOnce to an ftp server running Filezilla. I have taken care of port forwarding and firewall exceptions.
I can publish fine from the server itself, but when I try to publish from a different PC on a different network, it doesn't work.
I have tried both passive and active ftp modes, and it doesn't work with either of them. Active mode gives error 425 (can't open data channel).

VS remote debug problems

I am trying attach process on other PC to debug remote. But Type of code in the "Attach to process" dialog is always Native (x86 or x64) and never Managed code (my App is 100% managed). And after attaching I can't debug managed code. Why is that happens?
Now I have to change my question. The problem was in Remote transport mode(only native code support). But now I cant start working.
I made user with my login name and password on other PC with admin rights
I have run remote debugger from that user
After i chose Brows to that PC( server name from remote debugger), debugger says:
Unable to connect to server. The requested name is valid, but no data or the requested type was found.
On the remote computer look for in the Visual Studio Remote Debugging Monitor for something like Msvsmon started a new server named 'user#servername'...
Now, on the computer running Visual Studio enter the same server name in the Qualifier text field in the Attach to Process window. Unless you're on a 'safe network', leave the Transport at Default.
You should now be able to see your application under Available Processes.

RPC server is unavailable when connecting to WMI on a remote computer

A server had to be re-built after Hard drive crash..
After installing exact Image of the Server software, The WMI fails to connect when called (RPC Server is unavailable) from another computer.
However, Can connect using Visual Studio (2005) Server Explorer.
The calling server is Windows 2000 server and the called is Windows 2003. Both computers firewalls are disabled and appropriate rights are assigned to the calling and called accounts.
Check both the server and the client's event logs for any suspicious entries that might suggest what is misconfigured. Also, check what are the identities of Visual Studio and the app that calls WMI and if they are not the same, what's the difference in their security configuration.
The culprit is simply the netbios name..
Prior to re-build the computer name was 'rulestream'
After re-built some how it is given 'rulestream.myDomain.com'
I was able to spot the difference using Sysinternals TcpView.. Thanks Sysinternals

VPN authentication in C#

I have a VPN in my office. One machine has windows server 2003 installed. I am coding an app in C# to upload files from a machine connected to the server machine on a shared folder.
The file transfer code has been written, but it throw Access denied exception when I run it.
However when I open the shared folder using windows explorer and key in my username and password, then it works like a charm.
I need to know why it's throwing this exception and what code should I write to automatically authenticate myself from the code without going to windows explorer and entering credentials there.
Update --
.net version is 2.0, I can upgrade if its necessary but I dont think its the issue.
Iam running the application on the local machine.
I solved the issue using impersonation.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306158
http://www.codeproject.com/KB/cs/cpimpersonation1.aspx

Categories

Resources