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.

항상 다음이 있습니다.

  • RDP
  • VNC
  • 텔넷
  • SSH
  • 윈도우상의 리눅스

마지막 3개의 경우 추가 소프트웨어를 설치해야 합니다.

VNC는 독립 실행형 바이너리에서 실행되거나 설치될 수 있습니다.

RDP의 경우 대부분의 Linux 시스템이 이미 rdesktop설치되어 있거나 패키지 관리자에서 사용할 수 있습니다. Windows 시스템에 대한 RDP 연결을 활성화하기만 하면 rdesktop전체 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그런 다음 OS 에서

ssh username@Windows_ip

여기서 사용자 이름은 계정 이름이고 Windows_ip로그인하려는 Windows 컴퓨터의 IP 주소입니다.

답변3

예, Linux 클라이언트에서 Windows Machine에 연결할 수 있습니다. 하지만 이를 위해서는 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

관련 정보