这里加一点小小的小提示:对于刚毕业的大学生,如果你找工作的地方不在你的户口所在地的那个省份,记得过去以后要提前注册出租屋,提前把暂住证或者居住证拿到手,要不然很多本地的考试你都不能参加,昆明这边的可以使用微信小程序安居昆明进行注册申请。
可以远程连接服务器的python编辑器:https://zhuanlan.zhihu.com/p/222452460
配置vscode 远程开发+ 免密登录
1.下载和安装好vscode以后,安装插件remote development
image.png点击这三个地方去进行安装一个远程的插件,
2.check ssh是否安装成功:
打开cmd输入ssh -v
C:\Users\jiarf>ssh -v
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
这样就表明安装成功
3.生成密钥
C:\Users\jiarf>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\jiarf/.ssh/id_rsa):
Created directory 'C:\Users\jiarf/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\jiarf/.ssh/id_rsa.
Your public key has been saved in C:\Users\jiarf/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:F5xVIzVXaTgRx89XlXlyJ/ntsrViZugI7x3358CeJfc jiarf@DESKTOP-4V914A8
The key's randomart image is:
+---[RSA 2048]----+
| o=XoX|
| . o +=X=|
| + o**|
| . *|
| S . ..|
| . .. o|
| . ...+++|
| o o.o*oBo|
| .+.o+ +oE|
+----[SHA256]-----+
只要输入ssh-keyge
就可以,其他的一直按回车,这里可以看到保存的地址在C:\Users\jiarf/.ssh/id_rsa.pub
记得把这个文件上传到自己的服务器的~/.ssh文件夹中,
4.server上生成 authorized_keys
09:42:17 jiarongf@172.16.10.223:/data1/jiarongf
$
cd ~/.ssh
09:43:18 jiarongf@172.16.10.223:/home/jiarongf/.ssh
$
cat id_rsa.pub >> authorized_keys
10:52:02 jiarongf@172.16.10.223:/home/jiarongf/.ssh
$
l
authorized_keys id_rsa.pub
这样就配置好服务器了,接着
5.修改vscode的config file,加入 IdentityFile 和对应的本机私钥路径
image.png image.png然后就成功了。
网友评论