Visual Studio: SSH refuses to connect - visual-studio

If you go into Options > Cross Platform, where's an option to set up an SSH connection. However, I cannot force this thing to connect.
I have a Linux machine, I can connect to it with PuTTY just fine using password authentication. However, when I try to configure a connection in Visual Studio, it highlights the username and password boxes in red, as if there's a problem with them. I have no idea why it's not letting me log in. No matter which account I try, it just refuses. There's no diagnostic message or anything, it just highlights the fields in red.
Is there some prerequisit I'm missing? I don't understand why it won't let me connect. Is there somewhere I can look for extra diagnostic output?

OK, so it took me quite some time to figure this out. I'm writing this in case it helps anyone else...
Options > Cross Platform > Connection Manager is the page I was looking at, where you can set up an SSH connection. However, if you go to Options > Cross Platform > Logging and Diagnostics, you can click a button to turn on diagnostic logging. (!)
Once logging was turned on, VS reports:
Renci.SshNet.Common.SshAuthenticationException: No suitable authentication method found to complete authentication (publickey,keyboard-interactive).
In other words, VS isn't even trying to authenticate, because none of the available methods on the SSH server match the methods VS is trying to use.
Long story short, it turns out password authentication is disabled on the SSH server. "What?! But I use password authentication every day to log in!" No, you do not. Apparently there is "password" authentication and "keyboard interactive" authentication, and these are somehow not the same thing. You log in using "keyboard interactive" auth, which is enabled, but VS is trying to use "password" auth, which is disabled. Once you realise this, it's perfectly obvious why you can't log in.
So, go edit /etc/ssh/sshd_config, and turn on password authentication. (In my case, there was a line that literally says PasswordAuthentication no. Change that to yes, restart the SSH daemon, VS can now connect just fine.)

Related

Script to Log into several user accounts

We manage several laptops that are used for emergency situations and thus are rarely used (knock on wood).
When we start up these laptops periodically to run windows updates, we also sign in with several user accounts for each laptop in order to keep the profile up to date.
Is there a way to automate the logging in of each account with a script?
For example, I could log in as administrator, run the script and the laptop would do the following:
Log out my administrator account,
sign in with useraccount 1, log out
sign in with useraccount 2, log out
sign in with useraccount 3, log out
I havent had much luck in googling this type of thing and was hoping someone here might have an idea.
I simply cant find a script that logs in with a user account.
The closest I can find is recommending auto signin but that only applies to one account and not what I need for this task.
Globally, you can't do that: it would break security if you were allowed to interact, programmatically, with the login screen.
IF it's possible, I would look to a way to do the login to remote machine through either Telnet (not recommended! but can be done with standard Windows tools) or SSH (will need a SSH server). If you can do the upgrade this way, then you're saved, in particular with SSH because you can avoid passwords' sharing through key exchange - probably won't work with domain accounts, however, but local accounts will be fine.
Otherwise, if you require to really open a Windows session, best you can do, IF your configuration allows it AND if it works (regarding the profile's update) is to connect through RDP (Remote Desktop) to each laptop, with each login.
You'll need to establish a RDP connection to each laptop from a "pilot" PC, save each connexion individually within a .rdp file, saving password inside the connection file.
Then, you can launch the connection with the command mstsc <machine+account>.rdp to establish a connection. A bit later, you can kill the connection (with either taskkill or through a pilot process / tool, I would use AutoIt for this preferably).
If password saving is an issue, then each employee should have its own set of RDP files. Through something like Autoit, in particular, you can input the password once, and fill automatically each password prompt.
The tricky part would be to know when it's time to close the remote desktop. I would try to automatically execute a command to distant computer that would reboot it once done, so your remote desktop would close automatically.
Anyway, it will be a real gas plant to implement all this in a smooth process...

MacOS not storing proxy settings in keychain

I am having issues with the UI prompt which is asking me to enter my password to access the keychain credentials for proxy.
My mac is used in a local network without internet access, so I need to setup a proxy connection with username and password for browsing and all other mac services. I configured proxy including authentication in network settings. When browsing, chrome asks me once to enter credentials and it is working fine after then. If any other system service tries to connect, I am getting prompted to enter my password so proxy credentials can be fetched from keychain. I also changed the keychain entry to allow all applications to access it, but the prompt keeps on asking and asking and asking for my password. The next time, the keychain entry is changed back again to allow only some applications. Looks like it is always overriding the old entry.
Any ideas how I can fix that? Unfortunately I do not have any access on configuration of the proxy server or to change any parameters there, if it is a configuration issue of the proxy server. But there has to be a solution, I do not think entering the password hundreds of times a day can be an accepted solution.
My Mac is newly setup and running macOS Big Sur 11.2.1
Have you seen this answer https://apple.stackexchange.com/questions/106742/mac-username-password-for-proxy-settings-keep-resetting-by-itself? Usually you can move the password item in the keychain to the System section rather than the login section and this fixes the issue.
I have a similar issue but I am in a corporate environment and my issue seems to be related to NTLM https://apple.stackexchange.com/questions/292835/how-to-store-proxy-credentials-on-macos-so-they-are-used-by-system-services?rq=1

How to programmatically setup a dialup connection

I have a question - is there some way to set a login and password for a certain dial up connection?
I am able to create a Dial Up connection, however I'm unable to "save" the password and login into Windows (so it would remember them).
Please note that I want to do it without the Windows GUI, ideally just using regedit/cmd or windows default tools (that can be executed from cmd).
I needed to do this for Windows CE so I used the remote registry editor to compare before and after adding a dial up connection. I found the settings in [HKEY_CURRENT_USER\Comm\RasBook\ConnectionAddedByMe], hopefully you can do the same locally.

Can't connect to Team Foundation Server

I've been happily using Team Foundation Server with Visual Studio 2010 for the last couple of months at my current place of work when it has suddenly stopped working. I get the following errors:
If I browse to the wiki (Sharepoint) on the TFS server it works fine in Firefox but in Internet Explorer it fails with:
No authority could be contacted for authentication.
I'm not aware of any changes to the server or my machine that would cause the errors and other users of TFS are not affected.
The TFS server is on a different domain to my machine, but usually I get prompted to login and using a domain prefixed username works. At the moment, I don't even get a login prompt anymore.
How do I fix this?
I have recently started to experience a similar issue. We also host TFS on a different domain. Twice in the last week TFS has stopped authenticating users, and I have received messages similar to above. I have no idea what is causing this, but on each occasion SQL Server Agent service was stopped. A reboot of the server and a manual restart of SQL Server agent seems to fix the problem temporarily. I'm not sure if this information is helpful, but I would also really appreciate any help in getting to the bottom of this.
We used a workaround to get past this problem. We configured an entry in the Windows Stored User Names and Passwords tool for the domain of the TFS server. It got around the problem of TFS not prompting for credentials by explicitly supplying them via this tool.
When you change your password for that domain account, you must also change the password here otherwise your account can be locked after failing authentication too many times.
I had the same problem, sorted it by upgrading to tfs2012
In my case, I changed the default port 8080 to port 80 and everything worked fine. but the message could also happen due to wrong saved credentials. you can go to the control panel of the windows and search for credentials manager and then remove your TFS credentials.

Cannot Access http://<tfs-server>:8080

I've installed TFS 2008, but I can't seem to access the server. When I try to connect to it in Visual Studio, I can't. If I try by browser on a remote PC, I get a generic page cannot be displayed. On the server, I get a 403. Nothing was touched in IIS and the service is running as a Network Service. Any ideas?
try:
http://localhost:8080/Services/V1.0/ServerStatus.asmx. This will tell you if TFS is up and running. If you are getting anything else you need to look into IIS issues.
I wrote a blog post on diagnosing these types of TFS connections.
http://blogs.msdn.com/granth/archive/2008/06/26/troubleshooting-connections-to-tfs.aspx
The very first thing I do is confirm that it works for a known-good configuration – usually my workstation.
Providing that works and the server appears to be functioning, the next thing I do is ask the user to call the CheckAuthentication web service using Internet Explorer.
The URL for this is: http://TFSSERVER:8080/services/v1.0/ServerStatus.asmx?op=CheckAuthentication
By doing this check, I am doing four things:
Eliminating Team Explorer from the picture
Eliminating the .NET networking stack from the picture
Ensuring that Windows Authentication is working correctly (that’s why I say IE)
Ensuring that proxy settings are set correctly
In most cases I’ve seen, the TFS connection issues are because the proxy settings have changed or are incorrect. Because .NET and Visual Studio use the proxy settings from Internet Explorer, it’s important to have them set correctly.
In rare cases it’s beyond this. That’s when I start looking at things like:
Can you resolve the server name?
Can you connect using the IP address?
Are there HOSTS file entries? (see: c:\windows\system32\drivers\etc\hosts)
Can you ping the server?
Can you telnet to port 8080?
Does the user actually have access? Run TfsSecurity.exe /server:servername /im n:DOMAIN\User to check their group memberships
Have you changed your domain password lately? In some cases they’ll need to logoff the workstation and log back on again to get a new security token.
Is the computer's domain certificate valid? update the certificate: gpupdate /force
Hope this helps.
Turns out the time and date on my computer was not "close enough" to the time and date on the tfs server. Changed my system clock setting and problem went away.
What happens if you send a simple HTTP request to the server directly?
ie:
telnet 8080 [enter]
GET / HTTP/1.1[enter]
[enter]
[enter]
That might give a hint about whether IIS is actually serving anything. If you can do that on the server, what about from a different machine? If the results are different a good guess is there are some security/firewall issues somewhere. HTH a little.
I went through everything on a similar problem.
I logged onto my tfs server and connected directly there.
I also used a TFS admin tool I downloaded some time ago from Microsoft, and made sure I was in all the right groups and projects.
I then went back to the client PC with the problem, tried the services/1.0/serverstatus.asmx?op=CheckAuthentication Url again, and it worked this time.
AFter that full service was restored to my PC.
So I don't have the exact answer, but I would go through the checklists presented by Grant Holliday in his answer.
Add this to the cases for future users, as i had this issue on server 2016...
if your firewall allow only Domain and Private Network, it may not work on client. make sure you give public permission, if server network is set to public...
The error you may face:
ERR_CONNECTION_TIMED_OUT
for
http://fserver:8080/tfs

Resources