How to save project to filesystem you've SSHed into? - ssh

I've used ssh to connect to a remote filesystem from my local machine. I have a project saved on my local system that I want to test on the remote system. I want to transfer the project from my local system to the remote system I've SSHed into.
Does anyone know how to do that?

Use scp:
scp -r /local/directory/ username#remote_host:/remote/directory/

Related

Share a folder between my EC2 windows instance to my local PC

I have a process that creates an EXCEL file on a local folder on my local PC.
I want to share this folder \ file with my EC2 instance on AWS.
FXs it's not an option because the costs are very high, file size is smaller than a 100MB.
any idea?
The answer is secure copy AKA: SCP.
SCP uses SSH (hence the name secure copy bit) because you are using a windows machine you'll need to make some changes to your machine first.
You should either look into WSL(windows subsystem for linux) or use native PowerShell, specifically this pkg

How to access the windows subsystem for linux 2 filesystem from another computer?

I know that I can access the wsl2 filesystem by just opening \\wsl$ on the local computer. Can I somehow expose this to another computer in the same network? The goal is to just have a network drive on a remote computer where I drop files to copy them directly to wsl2.
EDIT: While it is not exactly what I wanted, I just noticed I can run a FTP server inside wsl2 and just transfer files in and out that way. I am still leaving the question open though as there might be a simpler solution to this.
You can find your home folder of wsl on c drive (its in AppData) and use ordinary windows folder sharing.
You can mount your network storage directly into WSL like in a particular Linux.
Example for Ubuntu and SMB: https://askubuntu.com/a/1050499

How to load package to openwrt in virtualbox

I have created an image of OpenWRT(x86-64) which I am running on Virtualbox. I have created a custom package and build it for my Virtual Machine. The thing is that I can not figure out how to copy the package file to the virtual machine's disk space.
I tried using using Guest Additions for Virtualbox but I think OpenWRT does not support it because I can not mount the file to install Guest Additions.
Is there any other way or am I doing something wrong?
To answer my own question, you can use Secure Copy (scp) to transfer your files.
Here is the link. SCP Example
SCP uses ssh to transfer files. Make sure that you have root password enabled in your remote host as this is needed to make a connection.
I hope that this may help someone in the future.

transferring files from remote host to local machine

I used ssh -X <ip_addresss_of_remote_host> to connect to a remote host from my local computer. I am using ubuntu 12.04. Now that I can browse internet on the remote host by opening firefox using "firefox" command in the terminal. Now any file I download from the internet goes to the remote host. Is there anyway I can setup the connection such that a file downloaded comes directly to my local computer??
I'm assuming you're using a browser on a remote host for some good reason. Therefore, the get those files to your local computer, put the downloaded files somewhere in your user path, then FTP to the remote host and download the files to your local machine.
One possibility would be to set the download directory in your remote firefox session to a shared directory that you have access to on your local machine as well.
However, if I were you, I'd just copy the downloaded files to your local machine using rsync:
rsync -az <remote_host>:/path/to/firefox/download/dir ./dir
You could use sshfs to mount your local directory on the remote server. That way, even though the file would be downloaded on the remote server, it would actually be stored on your local computer.

call a program from local terminal while in an ssh session

Is there some way to call on a local program while using an ssh connection to a remote host? I'd like to have access to the environment on both sessions, so opening another terminal isn't ideal.
Edit: specifically the uses would center around scp or local programs that use it (i.e. the emacs extension tramp). The two things I had in mind:
to be able to type download x.png on a remote machine and have the file pulled to my computer.
something like emacs-local file.py that would open emacs on my local computer and use tramp to edit file.py.