vscode-ssh 连接ubantu

如何在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连接

我的   ssh://youxueyin1@10.221.114.200   youxueyin1(ubantu的名字)10.221.114.200 (ubantu的里ifconfig一下)

按回车确认出现保存地址


连接#

注意要点#

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

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

5,本地shell可以连接远程服务器,但是vscode没有报错显示无法连接远程

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值