0%

WSL配置

建立ssh 服务

  • 首先是卸载重装一遍ssh服务,自带ssh服务无法建立远程连接。

    1
    2
    sudo apt-get remove openssh-server
    sudo apt-get install openssh-server
  • 编辑sshd_config文件,修改几处配置才能正常使用用户名/密码的方式连接

    1
    sudo vi /etc/ssh/sshd_config

修改SSH Server的监听端口,这里修改为23

1
sudo sed -i '/Port /c Port 23' /etc/ssh/sshd_config

修改SSH Server的监听地址。

1
sudo sed -i '/ListenAddress 0.0.0.0/c ListenAddress 0.0.0.0' /etc/ssh/sshd_config

PasswordAuthentication yes # 允许用户名密码方式登录

  • 修改完之后重启ssh服务

    1
    sudo service ssh restart

修改用户名

1
2
3
4
5
6
7
8
9
10
11
12
先创建root密码:sudo -s 进入root
passwd root后输入要创建的root密码

[cany@0152LO2061907W Fri Sep 20 10:38:03]/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919
$su
Password:
#简单的说就是把cany全都替换成yincan
root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi /etc/passwd
root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi /etc/shadow
root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi /etc/group
root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# mv /home/cany/ /home/yincan
root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# su -l yincan

在WSL上使用python

http://www.erogol.com/using-windows-wsl-for-deep-learning-development/

1570605454511

bashrc配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
alias l="ll -hrt"
alias L="l -L"
alias les="less -S"
alias mkdir="mkdir -m 755 "
alias tarxzf="tar -xzvf"
alias tarxjf="tar -xjvf"
alias tarxf="tar -xvf"
alias tarcf="tar -cf"
alias tarczf="tar -czf"
alias tarcjf="tar -cjf"
alias rm="rm -i"
alias grep='grep --color=auto'
LANG=en_US.utf8
SYSFONT="latarcyrheb-sun16"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
export LANG
PS1="\[\e[1;33m\]\u@\t \[\e[1;36m\]\w\[\e[1;35m\]\nBASH--->\[\e[0;37m\] " #server
alias ipython='ipython.exe'
alias python='python.exe -i'
alias pip='pip.exe'

# another PS1,my WSL
PS1="\[\e[1;36m\]\w\[\e[1;35m\] ---> \[\e[0;37m\]"