Posted in Linux, Network, Visual Studio Code, Windows

VS Code SSH remote connect to Linux Server (Real Solution)

First of all, forget the one who told you using Putty to generate the key, it’s outdated now.

Why? Because in the past, only Linux supports SSH so that Windows should use third party tool to realize SSH remote connection. But now Windows 10 supports native SSH Client, so you must get used to this one and avoid strange errors or wrongs.

Then, let’s see how to generate SSH key by native SSH Client. It’s easy. Open your local terminal (Linux or Windows) and execute:


In fact, though there is many options can be added, I only recommend one:

ssh-keygen -C username

Must be uppercase C and you can change the username to be any name you want to use, but that should be used to log in your Linux Server as its username later. It should be the same as your Linux username.

After you execute the command, you just follow the instructions on the screen. If you want not to overwrite the existing key files, change the default directory. If it suggests you to input Phrase, that can be empty, just enter directly.

When done, remember the default directory in the instruction just now? For Windows, you can cd into C:\Users\your_username\.ssh\; for Linux, you can cd into home/username/.ssh/.

Now you can see two files: id_rsa and

pub means public, so its a public key. For the other with no extension, it’s a private key.

Here is the annoying question: where should I put them?

Well, if you look up on the internet and you will find too much information about that but you will be more confused.

Exactly, ssh-keygen is just a tool to generate keys, that’s all. It’s not about how to connect. So whatever you generate on Windows or Linux, Client or Server, that’s fine, don’t care about it. You just use a tool to generate two files.

But then the following question again is: So where should I put them indeed?

Well, maybe there is many theories behind the scene, but let me tell you the simple truth: client stores the private key and server stores the public key.

For example, you have PC A and PC B, you want to use PC A connect to PC B, so you should store the private key on PC A and store the public key on PC B.

But you should always make sure they are in a pair because you may have generated many key pairs before or later.

Now let’s move on.

Now that we have known we should upload our public key on the server, let’s do it. If your client is Linux, thats easy, using:

 $ ssh-copy-id user@host

But if you are using Windows, ssh-copy-id should not work. So we need to understand what ssh-copy-id does.

Okay, we find a new file called authorized_keys. Go to your Linux server (use shell, SFTP or GUI), create that authorized_keys file under home/user/.ssh/ and copy the pub file contents (you can open it by VS Code) and paste into the new empty file. Save it.

In fact, id_rsa and is not necessary here

In case, reboot your Linux server now.

And now we should care about our path to store the private key. If you generate the keys on Windows directly, you should store it under C:\Users\username\.ssh\. If you generate it on Linux but you want to let it be stored on your Windows, you should download it from the Linux first. How to download it? I think SFTP is the best way. Use your SFTP tool to download it from Linux path home/username/.ssh and then store it under the same path on Windows.

Now we should check what we have done before we go on:

  1. we generate SSH Keys in a pair using ssh-keygen
  2. we store the private key on our client Windows PC (under C:\Users\your_username\.ssh\)
  3. we store the public key on our server Linux PC (under home/username/.ssh/authorized_keys)

Now let’s move on.

Open your VS Code, install SSH extensions in Extension Store. After installation, you will find a new icon on the side bar. Click it.

You can add new connection by “+” button. Follow the instruction on the top popped out dialog. After done, click ⚙ button. It will let you choose the path where SSH key files store. Then you will open a config file.

You can edit something here:

Host will change the UI display on the panel.

Hostname: the IP address or URL of your server.

User: should be the same as ssh-keygen -C username.

Port: the SSH port. Default is 22.

If you are using Virtual Machine like VirtualBox, you need to forward your Virtual Machine port (like 22) to the Host Machine port (like 12345).

IdentityFile: if you don’t add this option, VS Code will use the default ssh path (C:\Users\username\.ssh). But if you have many SSH key files to store in different paths, you should tell VS Code where is that file. On Windows, the “\” should be changed to “\\”.

Edit this file as your condition and save it.

Before we go, a small thing we need to deal with: go to C:\Users\username\.ssh, you will find a file called known_hosts. Delete it, it will be regenerated itself.

Return your VS Code panel, move your cursor on the server you want to connect, an icon will be shown on the right. Click it and you will begin connection in the new window. Follow the instruction on the top pop out dialog, then everything should be done.

Enjoy it!

Posted in Windows

You will never disable Windows Defender in Windows 10 1909 (Solutions attached)

My PC has been naked for many years because I nearly use anything unknown or dangerous.

For the older versions of Windows, which is before 1909, I disable Windows Defender in the Group Policy (gpedit.msc). Howerve, I find it doesn’t work any more.

If you install the OS all freshly and disable Windows Defender as soon as possible in the Group Policy, it will be fine. The Defender is totally sleeped.

But if you have opened and updated it once, the defender will be awakened and you won’t come back. It’s so annoying.

Even if you disable the real-time protection in the Group Policy, it will still update the data library automatically and turn on the real-time protection again.

Why must we focus on this problem?

Well, it’s funny.

You can open your task manager and find a progress or a service named Antimalware Service Executable. Click the “>” button, you will find a service named Windows Defender Antivirus Service.

The memory usage of it is very incredible, up to 100MB! And if you open a new program, it will check first, you PC will be slow, the opening of the software is slow and the memory usage will be added more.

Well, it’s not funny at all.

How to disable it?

As I said before, the Group Policy doesn’t work any more.

Here are two solutions.

Solution 1:

You can exclude the root folder of disk drivers in Windows Defender.

Forget the Chinese language and I wish you will find the option by yourself.

Solution 2:

Do as following. Copyright belongs to the original writer or the website.

Posted in Windows

The Latest Version of Visual C++ I Have Known So Far

  • 2005 (it’s hard to download latest version directly from, you need to get it via Windows Update after you have installed the older version)
    • x86: 8.0.61001
    • x64: 8.0.61000
  • 2008 (it’s hard to download latest version directly from, you need to get it via Windows Update after you have installed the older version)
    • 9.0.30729.6161
  • 2010 (you can get it from
    • 10.0.40219
  • 2012 (you can get it from
    • 11.0.61030
  • 2013 (you can get it from
    • 12.0.30501
Posted in Driver, Windows







经搜索,有人出现过类似的问题,并提出了一个双显卡自动切换的概念(,认为在新切换窗口的时候显卡会切换到独显然后再切回来,从而造成卡顿,解决办法是终止一个名为nvida streamer sever的进程。但是我打开Nvidia自带的GPU活动状态程序监测,虽然出现卡顿现象,但是未发现独显调用的情况。同时在任务管理器中也看不到nvida streamer sever这个进程,于是作罢。不过如果采用专业的显卡检测软件,应该可以看到更精准的结果吧。






Posted in Windows

Win10 WLAN(WIFI)开关打不开的解决办法







就在我百思不得其解之际,突然想到这些天折腾过Ubuntu(本机新分区Grub引导接管BCD安装的),而且在Ubuntu上面也默认关闭过WLAN,这会不会是一种影响呢?忽然间,我发现一切问题都连接起来了:突然出现的无法打开(触发)、另一个操作系统(Ubuntu)、在另一个操作系统中关闭过WLAN(默认关闭,影响延续)。更重要的是,我想起来每次我从Ubuntu返回Win10,系统时间都被调成UTC+0的状态,但是我在Ubuntu下的时区是UTC+8,用着也没有什么问题。可是这确实是凿凿的证据了,Ubuntu确实是可以影响一些底层硬件的状态的!于是,我拿出Ubuntu引导安装U盘(主要是Grub被我给干掉了,所以只能拿U盘来开机了),但是这个时候,我又想到,虽然我拿U盘是因为现在无法进入Ubuntu,但是我可否就在Ubuntu Live(试用)下面去操作呢?完全说得通。

我用U盘引导进入Ubuntu Live,发现WLAN默认开启,使用正常。Fn+F5可以实现开关WLAN的操作。接着我又尝试着开关了几次,然后我发现和在Win10下一样,再也无法打开开关了。不甘心,重启进入Ubuntu Live,看了看打开着的开关和一行行SSID,心想,算了,就让它这么留着吧,回Win10看看去。重启返回Win10,WLAN默认开启,可以反复开关,接管成功。至此,问题得以解决。

所以总结一下,如果出现Win10无法打开WLAN开关的问题,确实要到另一个操作系统去先开启WLAN开关,然后Win10就可以接管操作了,具体原因未知。而另一操作系统则未必要重装一个新系统,除非你正好打算重装。最佳的办法应当是刻录一个Ubuntu Live或者找一个可以开关WLAN的PE(虽然我没见过这样的PE,不过假如这是Win10的bug的话,那么今后PE带WLAN开关也许会是一个必备的功能吧)。另外还有各种装在U盘里的操作系统,更是不在话下了。但是如果只是为了解决这个问题,大概选择刻录Ubuntu Live会是最好的选择。

Posted in Driver, Nvidia, Windows

Win10 Update just updated the Nvidia driver to 376.54 today and I have a method to install the old version which you want to restore

Win10’s update cannot be set to not update the driver and it always includes the driver that just released internal, not public. These versions’ drivers may cause some problems, especially compatibility problem.

The way to solve this problem is very easy, just following the steps below:

  1. Go to Nvidia’s Official Website to download the version you want to restore. If you have the version copy file in your disk , it’s okay. Anyway, first of all, you must store the version you want to install in your disk.
  2. Uninstall your updated driver from the Programs and Features, Control Panel. [Sometimes you cannot see the uninstall menu on the list so you must go to Device Manager to uninstall the driver. See: How to Uninstall Drivers in Windows]
  3. Cut off any connection to Internet.
  4. Reboot your computer.
  5. Install the driver that you want.

Things need to be careful:

  • If your favourite version is lower than the Win10 Update Version, you will follow the instruction again when you finish the update because the Win10 Update will always update your driver to the latest or higher version. If you want to disable automatic update on Win10, you can disable the relative services or policies. (See: How To Turn Off Windows Update In Windows 10)
  • If your favourite version is higher than the Win10 Update version, everything is okay and you can update your system at all time.