LinuxシェルからWindowsシステムに接続できますか?

LinuxシェルからWindowsシステムに接続できますか?

PuTTY / SSHを使用してWindowsからLinuxシステムに接続できます。私はその逆を望んでいます。 Linux から Windows システムに接続します。

可能ですか?

答え1

接続方法によって異なります。 Windowsコンピュータで共有を作成し、smb / cifsを使用して共有に接続できます。

構文はドメイン内にあるかどうかによって異なります。

# mount -t cifs //server/share /mnt/server --verbose -o user=UserName,dom=DOMAIN

$IPC管理共有をマウントすることもできます。プロセス間通信を表示し、共有で実行できる操作を確認できます$IPC

いつも:

  • リモート開発計画
  • 仮想ネットワークコントローラ
  • リモートログイン
  • SSH
  • Windows上のLinux

最後の3つの場合は、追加のソフトウェアをインストールする必要があります。

VNCは、スタンドアロンバイナリで実行またはインストールできます。

RDP の場合、ほとんどの Linux システムにすでにrdesktopインストールされているか、パッケージマネージャで使用できます。使用するには、rdesktopWindowsシステムへのRDP接続を有効にしてから、GUI全体のWindowsコンソールでRDPを使用できます。

答え2

開いている場合は、次のPowershellスクリプトを使用してインストールWindows 10できます。OpenSSH

#change dns server to 8.8.8.8 so that the OpenSSH stuff can be downloaded
netsh interface ip set dns "Ethernet" static 8.8.8.8

#sleep for 60 s so that the DNS server has time to register
Start-Sleep -m 60

#check if OpenSSH is already installed or not
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Check if OpenSSH is available
dism /Online /Get-Capabilities | findstr OpenSSH

# install the server and/or client features:
dism /Online /Add-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0
dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0

Install-Module -Force OpenSSHUtils

Repair-SshdHostKeyPermission -FilePath C:\Windows\System32\OpenSSH\ssh_host_ed25519_key

# start the ssh server daemon
Start-Service sshd

# This should return a Status of Running
Get-Service sshd

# add firewall rule to allow inbound and outbound traffic through port 22
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Service sshd -Enabled True -Direction Inbound -Protocol TCP -Action Allow -Profile Domain

このスクリプトは DNS を Google DNS に変更します。OpenSSHデフォルトのディストリビューションとして配布されていないため、 Windows10実際にインターネットからいくつかのファイルをダウンロードしてください。したがって、動作するインターネット接続と正しいDNSサーバーが必要です。そのため、ファイアウォールの背後にある場合、またはDNSサーバーなしで静的IPを使用している場合に備えて、固定DNSサーバーを指定しました。

Windows これを完了したら、ホストのIPアドレスを調べる必要があります。

ipconfig

Linux/Unix次に、オペレーティングシステムで次の手順を実行します。

ssh username@Windows_ip

ここで、ユーザー名はアカウント名で、Windows_ipログインする Windows コンピュータの IP アドレスです。

答え3

はい、LinuxクライアントからWindowsコンピュータに接続できます。ただし、これを行うには、Windowsシステムでいくつかのサーバータイプ(たとえば、telnet、ssh、ftp、または他のサーバータイプ)をホストする必要があり、Linuxにはそのクライアントが必要です。

答え4

Windowsでgitを使用している場合はおめでとうございます。これで、WindowsシステムにSSHで接続できます。

SSHサーバーを起動します。

net start "C:\Program Files\Git\usr\bin\sshd.exe"

次に、次の powershell コマンドを使用してファイアウォールを構成します。

New-NetFirewallRule -Name sshd -DisplayName 'SSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

関連情報