Skip to content

Instantly share code, notes, and snippets.

@SofijaErkin
Last active June 26, 2022 01:16
Show Gist options
  • Save SofijaErkin/c8c9e9fefe2fc6fd46e8540a907d8f54 to your computer and use it in GitHub Desktop.
Save SofijaErkin/c8c9e9fefe2fc6fd46e8540a907d8f54 to your computer and use it in GitHub Desktop.
Virtual machine Debian remote login Host machine macOS.

VM Debian remote login Host macOS

Just download VirtualBox in macOS, then, install Debian via VirtualBox in macOS.

For VM Debian, it can directly access the host machine macOS via macOS's local

IP. E.g: ssh [email protected]. So, we just need to set

at macOS and VM Debian.

refer:

1.The network configuration of Ubuntu after installing via VirtualBox in Mac(Chinese Blog).

1.macOS Settings

macOS Settings is that the SSH server settings while macOS has been remotely

logged in VM Debian.

1.1Install SSH in macOS

All modern Macs running macOS or Mac OS X come with SSH pre-installed by

default.

1.2Enable the SSH server

Apple logo -> Setting Preferences -> Sharing -> click Remote Login on

-> click Allow access for choose Only those users -> push + button ->

choose your current user name and push -> Select -> Watch Remote Login On

-> Notices To log in this computer remotely, type "ssh [email protected]"

-> OK.

1.4Ensure IP

Just use the one of the code to checkout the IP of macOS:

ipconfig getifaddr en0 or ifconfig | grep inet.

You will see:

macOS.local.ip.address

E.g: 192.199.3.27.

1.5refer

1.Enabling remote SSH login on Mac OS X.

2.MacOS access VM Ubuntu using SSH and the operation of cloud(Chinese Blog).

3.Macbook SSH with VM Kail and Settings auto login once Kail Power on(Chinese)..

2.VM Debian Settings

VM Debian Settings it that the SSH client settings while VM Debian has remotely

logged into the macOS.

2.2Test SSH with Host macOS

Just use the code: ssh [email protected].

E.g: ssh [email protected].

Then you got:

The authenticity of host '192.199.3.27 (192.199.3.27)' can't be established.

ECDSA key fingerprint is SHA256:xxx.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.199.3.27' (ECDSA) to the list of known hosts.

[email protected]'s password:

then input my macOS user password: my_macOS_user_password, then got:

Last login: Fri Month Day XX:XX:XX 20XX from 192.199.3.27 localhost

Just exit to quit the remote login.

Connection to 192.199.3.27 closed.

2.4refer

1.Macbook SSH with VM Kail and Settings auto login once Kail Power on(Chinese)..

2.MacOS access VM Ubuntu using SSH and the operation of cloud(Chinese Blog).

3.Running and Transmit Files on Remote Cloud/Host

Running files on remote Cloud/host could use ssh command, while transmit

files on remote Cloud/host macOS should be use scp command.

3.1Running files Cloud/Host via ssh

Write project on local guest VM Debian, run program in free remote cloud/Host

macOS via ssh the program to there. E.g: a program test.py under ~/ in my

local guest VM Debian, just use this code to run in remote cloud/Host

(e.g:macOS):

ssh [email protected] python3 < ~/test.py

Do not need to add -p port_target, because the ssh default port is 22, and

we use that port 22.

refer:

1.MacOS access VM Ubuntu using SSH and the operation of Cloud(Chinese Blog).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment