Is it possible to copy files from an Ubuntu VM to a Windows host without SSH?


529

Is it possible to copy files from an Ubuntu VM to a Windows host without SSH ?

I'm asking this because working with files over SSH requires me to install an SSH server on Windows (either on Windows itself or on WSL ) , and I'd rather pass it off as I have no other reason to do so.

This should use me to backup my files.

What I do now to backup files to WSL:

(
sudo mysqldump -u root --password --all-databases > /var/www/html/db.sql
sudo zip -r /var/www/html/dr.zip /var/www/html
sudo scp /var/www/html/db.sql /var/www/html/dr.zip USER@IP:/mnt/c/Users/USER/Desktop/
sudo rm /var/www/html/db.sql /var/www/html/dr.zip
)

As you can see, I used the code block above to copy files from Ubuntu to Windows via SSH.

I'd like to run a similar set of commands in Ubuntu to copy files to the host (Windows), but this time without SSH and using some local way.

lewis4u

The easiest way is to install samba and share a folder from the server.

  1. install samba

    sudo apt install samba
    
  2. Add your Linux user to samba:

    sudo smbpasswd -a <username>
    // then it will ask you to write the password
    // for that user and to confirm it
    
  3. In this file, /etc/samba/smb.confjust write to the end:

    [shared_folder_name]
    
    comment = some_comment
    path = /path/to/your/folder
    browsable = yes
    valid users = your_username
    read only = no
    

After that, you can see the folder on the network and access it like any other shared folder.

PS: I think you have to restart the samba service or just the VM!

Related


Copy files from ubuntu to windows using SSH in Putty-Windows

Sarika I have to stand in windows itself and copy the .csv file from ubuntu machine into windows machine. That is I have to do the copy process by running putty or something like that from a windows machine. I need it as a command because I have to use Java. S

How to move Ubuntu VM from Windows host to Ubuntu host?

284 I'm running an Ubuntu (12.04) virtual machine on VirtualBox. My host is Windows 7. I need to move (copy?) an Ubuntu VM in its current state to another computer where the host is Ubuntu. Is there a solution? Freyem You can use the "Import/Export Devices" op

How to move Ubuntu VM from Windows host to Ubuntu host?

284 I'm running an Ubuntu (12.04) virtual machine on VirtualBox. My host is Windows 7. I need to move (copy?) an Ubuntu VM in its current state to another computer where the host is Ubuntu. Is there a solution? Freyem You can use the "Import/Export Devices" op

Ubuntu Server 18.04 VM networking and SSH issues from Ubuntu host

Razputin What I am trying to do: I'm trying to setup an Ubuntu server 18.04.2 running Ubuntu 18.04.2 LTS on my laptop via Virtualbox. I want to ssh from my host to a VM server. question: Ubuntu server 18.04.2 only shows enp0s3(no IP) and lo(IP 127.0.0.1), no m

SSH Windows 10 VM from Ubuntu OS

road I have two computers. The first is Ubuntu and I am using a Windows VM (VirtualBox) on the second computer. I Bridge Adapteruse on a VM. Now, I can ping the VM, but if I want to SSH, I get it port 22: Connection Refused. Note that the firewall on the VM is

How to copy files from SSH remote host to Jenkins server

not bugs We use the Jenkins server for our daily build process and execute some bash scripts on remote hosts via SSH. The script generates an html log file on the remote host. We are using the " Copy to Slave" plugin to copy files on the slave machine and " Pu

Access the VM using SSH from the VM host

dvory59 I have Linux workstation in which I run another Linux virtual machine. The point is that my friend wants to try sshto establish a connection directly to my virtual machine, but we can't get it to work. ssh -R 2223:linda@virtualMachine:221 linda@workSta

Run command on Ubuntu guest in VirtualBox VM from Windows host

that 88 I'm writing some code and I have an idea that should work, but I don't know how to make it work. I'm running some code with Wolfram Mathematica on a Windows host, but I have to export the files to a Linux based program running in an Ubuntu Virtualbox V

Run command on Ubuntu guest in VirtualBox VM from Windows host

that 88 I'm writing some code and I have an idea that should work, but I don't know how to make it work. I'm running some code with Wolfram Mathematica on a Windows host, but I have to export the files to a Linux based program running in an Ubuntu Virtualbox V

How to copy paste from Ubuntu VirtualBox guest to Windows host?

Misha Moroshko I'm running VirtualBox 4.1.4 on a Windows 7 laptop with an Ubuntu 11.10 guest. I want to copy text from Ubuntu terminal and paste it into a file on Windows host. For some reason this doesn't work. Any ideas? Soekarno Start your VM, then install

How to copy paste from Ubuntu VirtualBox guest to Windows host?

Misha Moroshko I'm running VirtualBox 4.1.4 on a Windows 7 laptop with an Ubuntu 11.10 guest. I want to copy text from Ubuntu terminal and paste it into a file on Windows host. For some reason this doesn't work. Any ideas? Soekarno Start your VM, then install

How to copy paste from Ubuntu VirtualBox guest to Windows host?

Misha Moroshko I'm running VirtualBox 4.1.4 on a Windows 7 laptop with an Ubuntu 11.10 guest. I want to copy text from Ubuntu terminal and paste it into a file on Windows host. For some reason this doesn't work. Any ideas? Soekarno Start your VM, then install

Copy files from remote host to another host using scp/ssh tunnel

Moritz H. I want to copy a file from a remote host (remote1) to another remote host (remote2) via my local computer. I can only establish an ssh connection from this local computer to either of the two remotes. There is no connection between them and I can't c

Copy files from remote host to another host using scp/ssh tunnel

Moritz H. I want to copy a file from a remote host (remote1) to another remote host (remote2) via my local computer. I can only establish an ssh connection from this local computer to either of the two remotes. There is no connection between them and I can't c

Copy files from LXC to host

Tina J I am new to containers. I have an LXC container running on a remote linux machine. All I've found online is how to copy files from host to LXC container. But how do I copy the files from the running LXC container to the host and eventually to my own com

Copy files from LXC to host

Tina J I am new to containers. I have an LXC container running on a remote linux machine. All I've found online is how to copy files from host to LXC container. But how do I copy the files from the running LXC container to the host and eventually to my own com

Copy files from local host to remote host

Thumbtack Thief This answer must exist somewhere because it's so basic, but I can't find it. I have a file on my local computer that I want to copy to a remote host. I know how to use scp, but if I use it from localhost to remote I get permission errors. I can

Virtualbox static IP for Windows VM on ubuntu host

Amrish I'm trying to setup a Windows VM on an Ubuntu host using a Virtual box. Since I will be running the SQL Server database on a Windows VM, I am trying to set a static IP on that VM. To do this, I followed the instructions provided here . Below is the Virt

Virtualbox static IP for Windows VM on ubuntu host

Amrish I'm trying to setup a Windows VM on an Ubuntu host using a Virtual box. Since I will be running the SQL Server database on a Windows VM, I am trying to set a static IP on that VM. To do this, I followed the instructions provided here . Below is the Virt