1. 程式人生 > >Access Windows Subsystem for Linux (WSL) by ssh

Access Windows Subsystem for Linux (WSL) by ssh

install ssh server

 apt install openssh-server

modified sshd_config

#   $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value. Port 22 AddressFamily any ListenAddress 0.0.0.0 ListenAddress :: #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_ecdsa_key #HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation no # Ciphers and keying #RekeyLimit default none # Logging #SyslogFacility AUTH #LogLevel INFO # Authentication: #LoginGraceTime 2m #PermitRootLogin prohibit-password PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 #PubkeyAuthentication yes # Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedPrincipalsFile none #AuthorizedKeysCommand none #AuthorizedKeysCommandUser nobody # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes #PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes PrintMotd no #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS no #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none #VersionAddendum none # no default banner path #Banner none # Allow client to pass locale environment variables AcceptEnv LANG LC_* # override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server

這裡寫圖片描述

start or restart ssh service

start or restart `ssh service`

connect wsl through xshell

ssh root@127.0.0.1:22

reference

相關推薦

Access Windows Subsystem for Linux (WSL) by ssh

install ssh server apt install openssh-server modified sshd_config # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07

Windows Subsystem for Linux (WSL)簡單嘗試

WSL安裝(以WinServers2016為例 dism /online /norestart /add-package /packagepath:Microsoft-Windows-Lxss-Optional-Package.cab /package

WSL(Windows Subsystem for Linux)的存放目錄

變化 sub tro win10 users limited blog ica 發行版 win10子系統把windows的底層接口做了個轉換到Linux從而能運行linux,但是他在安裝的時候並沒有提供安裝位置的選項.(還有hyper v) 現在,所有從商店安裝的發行版都存

wsl(Windows Subsystem for Linux)安裝簡易指南

14. lis tor OS 127.0.0.1 sys 鏈接 代號 mina 1. 在“啟用或關閉Windows功能”窗口中打開“適用於Linux的Windows子系統”; 2. 讓你的Windows更新程序將你的Wind

WSL(Windows Subsystem for Linux)的安裝與使用

版本號 store 強烈 ack tro class 技術 sudo aliyun 有關WSL的介紹這裏就不做解釋了。另外,本文僅適用於win10 build 16215以及之後的版本,之前的版本可參考官方鏈接。 (可使用“winver”命令查看w

WSL(Windows Subsystem for Linux)的安裝與使用及 mongodb安裝

and 多說 nec str ros dos 面板 name line 有關WSL的介紹這裏就不做解釋了。另外,本文僅適用於win10 build 16215以及之後的版本,之前的版本可參考官方鏈接。 (可使用“winver”命令查看windows

WSL (Windows Subsystem for Linux) 的 VSLAM (Visual Simultaneous Localization and Mapping) 道路

# **WSL 的 VSLAM 道路** --- > 以 **Windows Subsystem for Linux** 闖入 **Visual Simultaneous Localization and Mapping** 世界的艱難道路... 這裡包含各種各樣的 WSL 中可能用到的包,美化方案,以及

Windows Subsystem for Linux 環境變量

app environ game appdata sof less microsoft program /usr WSL(Windows Subsystem for Linux )的環境變量是包含Linux子系統和Windows系統的,測試如下: wy@WY-PC:/

Summary of Windows SubSystem for Linux

reat ive all 開源 inf sshd_conf sources pre remove Summary of Windows SubSystem for Linux Install Ubuntu Run PowerShell as administrator an

在Win 10的Windows Subsystem for Linux中安裝Kali

配置環境 While the setup is described well over at the WSL Distribution Switcher README file, we’ve made a quick 4-minute video to wal

Windows中的Linux子系統中執行python3 連線mysql資料庫時報錯Access denied for user 'root'@'localhost'

** 我是通過更換root密碼的認證方式解決的,新版mysql使用的caching_sha2_password,換成mysql_native_password我就可以連上了。 步驟是在windows系統中的Linux子系統編輯器的命令列連線mysql, 通過my

wsl(windows subsystem linux)

1.win10設定為開發人員模式,並安裝subsystem for linux(命令列輸入bash就可以安裝) 2.登入並su到root,然後修改/etc/sudoers,在最後一行加(一定要在最後一行): youname1 ALL=(ALL) NOPASSWD:ALL 3

關於WSL(Windows上的Linux子系統)的簡單介紹及安裝

更新 允許 服務器 不能 targe cnblogs 之前 xshel 設置 WSL,Windows Subsystem for Linux,就是之前的Bash on [Ubuntu on] Windows(嗯,微軟改名部KPI++ 首先要說一句,其實Win

WSL(Windows上的Linux子系統)

issues 介紹 gcc 基於 讀研 image 卸載 ssh 輸入 WSL(Windows上的Linux子系統) WSL,Windows Subsystem for Linux,就是之前的Bash on [Ubuntu on] Windows(嗯,微軟改名部KPI++)

Windows下食用Linux工作環境(WSL

aliyun 命令行 阿裏 一次 問題 turn ins 習慣性 不必要 在Windows下食用Linux工作環境(WSL) 為什麽要這麽瞎搞呢?因為最近換了個硬盤,搞了個雙系統,然後習慣性地按下 Ctrl+Alt+T 發現什麽都沒有召喚出來,然後忽然想起換了系統。 然

重置密碼解決MySQL for Linux錯誤 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

剛才 技術分享 自己的 png res 文檔 .com acc authent 一般這個錯誤是由密碼錯誤引起,解決的辦法自然就是重置密碼。 假設我們使用的是root賬戶。 1.重置密碼的第一步就是跳過MySQL的密碼認證過程,方法如下: #vim /etc/my.cnf(註

Windows系統中的LinuxWSL安裝及簡單使用

pow sta 微軟 -o reg 初始 命令提示符 通過 直接 Windows SubSystem for Linux(WSL) 適用於Linux的Windows子系統 WSL團隊的blog:https://blogs.msdn.microsoft.com/wsl/

Docker for Windows安裝與Linux+PHP開發環境搭建(二)

Docker for Windows安裝與Linux+PHP開發環境搭建(二) 上一篇講了docker安裝與環境搭建的步驟,這一次主要是介紹過程中遇到的錯誤情形及其錯誤處理方法: 1).執行docker pull local.registry.com:5000/php 或其他連線本地

Docker for Windows安裝與Linux+PHP開發環境搭建(一)

Docker是什麼? 簡單得來說,Docker是一個由GO語言寫的程式執行的“容器”(Linux containers, LXCs); 目前雲服務的基石是作業系統級別的隔離,在同一臺物理伺服器上虛擬出多個主機。Docker則實現了一種應用程式級別的隔離; 它改變我們基本的開發、操作單元,

安裝適用於LinuxWindows Subsystem

在為WSL安裝任何Linux發行版之前,必須確保啟用“Windows Subsystem for Linux”可選功能: 以管理員身份開啟PowerShell並執行: Enable-WindowsOptionalFeature -Online -Featur