当先锋百科网

首页 1 2 3 4 5 6 7

如何在Ubuntu上开启SSH服务 如何在Ubuntu上开启SSH服务_ubuntu开启ssh_枫★曦的博客-CSDN博客    不用下载putty,不知道是干啥的

2,VsCode通过SSH连接远程服务器开发(这段网上搜有细节)

安装插件#

安装VsCode官方插件
Remote - SSH

Remote - SSH: Editing Configuration Files

WSL(远程桌面连接需要Remote - WSL ms-vscode-remote.remote-wsl,因本文是SSH连接所以可有可无)

 

 

建立连接#

安装插件后会提示重启VsCode,重启后你会发现侧边栏和左下角均有变动

想要建立新连接,我们点击侧边栏的图标
鼠标移至TAG栏,点击+
在弹出框里输入ssh连接

按回车确认出现保存地址


连接#

 

注意要点#

  • 每次连接远程都需要输入密码
  • 连接新服务器插件需要重新安装插件
  • 有些插件不适配远程开发模式

VScode 删除远程资源管理器中SSH TARGETS

今天不小心输错了ip,想删除一下,无奈发现只有连接方法,没有删除按钮

后来发现需要在config文件中编辑删除,位置为User目录下的.ssh/config或者programdata下的该文件

文件格式如下

删除然后刷新一下即可

如果碰到下面的异常,说明打开的文件数目太多,需要重新配置下

"Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)#

When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. Before adjusting platform limits, make sure that potentially large folders, such as Python .venv, are added to the files.watcherExclude setting (more details below). The current limit can be viewed by running:

cat /proc/sys/fs/inotify/max_user_watches

The limit can be increased to its maximum by editing /etc/sysctl.conf (except on Arch Linux, read below) and adding this line to the end of the file:

fs.inotify.max_user_watches=524288

The new value can then be loaded in by running sudo sysctl -p.

While 524,288 is the maximum number of files that can be watched, if you're in an environment that is particularly memory constrained, you may want to lower the number. Each file watch takes up 1080 bytes, so assuming that all 524,288 watches are consumed, that results in an upper bound of around 540 MiB.

Arch-based distros (including Manjaro) require you to change a different file; follow these steps instead.

Another option is to exclude specific workspace directories from the VS Code file watcher with the files.watcherExclude setting. The default for files.watcherExclude excludes node_modules and some folders under .git, but you can add other directories that you don't want VS Code to track.

3 示例

可以在本地vscode打开ubantu文件,修改上传代码啥的

其他,ssh配置公钥私钥

windows-cmd命令框也可以

4,当服务器端重装系统后,再远程访问可能会有问题,解决如下

发生如下问题

ssh-keygen -R 10.221.110.130