![]() ![]() The first three methods can be used to access any virtual machines that you have ssh connection. I decided to write down four ways to achieve this goal. In this post, we will not go through performance considerations for each tool/method. There are no requirements for retaining the permissions on the files being transferred. We are referring to Linux virtual machines in this post unless we explicitly mention Windows virtual machines as well. They also need to download some result files or data to their local machines. Transferred: sent 2868, received 1288 bytes, in 0.2 secondsīytes per second: sent 17994.5, received 8081.There is a common need for our university researchers to securely transfer small or large files to virtual machines for various purposes. Here is my unsuccessful attempt: $ fly proxy 10022:22Įxecuting: program /usr/bin/ssh host localhost, user root, command sftpĭebug1: Reading configuration data /etc/ssh/ssh_configĭebug1: Connecting to localhost port 10022.ĭebug1: connect to address ::1 port 10022: Connection refusedĭebug1: identity file id_windworld type 3ĭebug1: identity file id_windworld-cert type 7ĭebug1: Local version string SSH-2.0-OpenSSH_9.0ĭebug1: Remote protocol version 2.0, remote software version Goĭebug1: Authenticating to localhost:10022 as 'root'ĭebug1: load_hostkeys: fopen /home/grfork/.ssh/known_hosts2: No such file or directoryĭebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directoryĭebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directoryĭebug1: kex: algorithm: curve25519-sha256ĭebug1: kex: host key algorithm: ssh-ed25519ĭebug1: kex: server->client cipher: MAC: compression: noneĭebug1: kex: client->server cipher: MAC: compression: noneĭebug1: expecting SSH2_MSG_KEX_ECDH_REPLYĭebug1: Server host key: ssh-ed25519 SHA256:1XGryNxflX9P4SKI8sp8/C3YPVgR79AnWzAOe98f5pYĭebug1: Host ':10022' is known and matches the ED25519 host key.ĭebug1: Found key in /home/grfork/.ssh/known_hosts:16ĭebug1: get_agent_identities: agent returned 1 keysĭebug1: Will attempt key: (none) RSA SHA256:hSJsG29I25UZ6e8wbA5rpWLHPDbKWRhuH3PJNAGYxPI agentĭebug1: Will attempt key: id_windworld ED25519 SHA256:ySJYo2Nop9CIATSKtlig5ew8fxICIZqQfE8g4dsTGSg explicitĭebug1: Will attempt key: id_windworld ED25519-CERT SHA256:ySJYo2Nop9CIATSKtlig5ew8fxICIZqQfE8g4dsTGSg explicitĭebug1: Authentications that can continue: publickeyĭebug1: Next authentication method: publickeyĭebug1: Offering public key: (none) RSA SHA256:hSJsG29I25UZ6e8wbA5rpWLHPDbKWRhuH3PJNAGYxPI agentĭebug1: send_pubkey_test: no mutual signature algorithmĭebug1: Offering public key: id_windworld ED25519 SHA256:ySJYo2Nop9CIATSKtlig5ew8fxICIZqQfE8g4dsTGSg explicitĭebug1: Offering public key: id_windworld ED25519-CERT SHA256:ySJYo2Nop9CIATSKtlig5ew8fxICIZqQfE8g4dsTGSgexplicitĭebug1: Server accepts key: id_windworld ED25519-CERT SHA256:ySJYo2Nop9CIATSKtlig5ew8fxICIZqQfE8g4dsTGSg explicitĪuthenticated to localhost (:10022) using "publickey".ĭebug1: channel 0: free: client-session, nchannels 1Ĭonnection to localhost closed by remote host. Then I tried to do apt install openssh-client in the Docker image with no effect. I thought maybe I should restart sshd service but systemctl doesn’t seem to work: “System has not been booted with systemd as init system (PID 1). Tried installing scp binary to no effect. I tried too, ssh-ing works fine, scp throws error “Connection to localhost closed by remote host.”. I fixed that with: ssh # SSH into my alpine imageĪfter that, I was able to scp from my client with: scp foo/ My app was running a minimal Docker alpine image, so it didn’t have the scp binary. I didn’t realize this, but for scp to work, the scp binary has to be present on both ends of the connection. # When prompted, save to a file, like nfįly wireguard create "$" /etc/wireguard & \įrom here, you’ll be able to SSH into your VM from your dev machine: APP_NAME="yourappname" # Change to the name of your fly VM WG_PEER_NAME="devbox" # Change to any name On my client machine, I installed Wireguard: sudo apt install -y wireguard-tools resolvconf & \Īnd then I added my local dev machine as a Wireguard peer: FLY_REGION="ewr" # Change to your app's region Here’s what I did in case it’s helpful for anyone else. ![]() I tried running flyctl ips private, but I couldn’t ssh to the IP address from my client machine. ![]() I wasn’t able to scp using the instructions above. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |