


the client and server to be in the same network (which is not the case if you're at work trying to access your home computer).X11 on the client (if you have it, xclip on the server works great) or.Put the script somewhere in your path, make it executable and voila: ls | cb I saved it with the file name cb (my mnemonic (ClipBoard). In my case, i'm using a specially named key Other examples: ls | ssh desktopIpAddress pbcopyįor convenience, I've created a bash file to shorten the text required after the pipe: #!/bin/bash It's much easier if you've set up ssh keys to facilitate fast ssh usage, preferably using a per-session passphrase, or whatever your security needs require. It requires your desktop to be configured as an ssh server (which I leave to you and google).

In other words, it uses nested ssh: you're connected to the remote computer via one ssh session, you execute the command there, and the remote computer connects to your desktop via a different ssh session and puts the text to your clipboard. ls, pwd) and pipes the output to the clipboard of the local computer (the name or IP of "desktop"). When run in an ssh session to a remote computer, this command takes the output of commandThatMakesOutput (e.g. The essence of the solution: commandThatMakesOutput | ssh desktop pbcopy Like the OP, I wanted to be able to transfer small bits of text from terminal to my local clipboard, using only the keyboard. In my case, I use Terminal on my local OSX machine to connect to a linux server via SSH. It's a minor modification to a suggestion from OSX Daily. That’s why I consider this method the most useful for copying files between Linux boxes: it is fast and visual: you can see everything that’s happening.I'm resurrecting this thread because I've been looking for the same kind of solution, and I've found one that works for me. You can do anything you want with remote files as they were local. Just enter it and you are in! The next screen that should appear is one with two mc panels: one local and one remote.
Ssh copy a file windows#
Answer yes to the question that appears: Are you sure you want to continue connecting? Just type yes in the command line (on Windows mc interface is messed up when you’re trying to connect, but I hope you’ll find where to type it). Just type in the hostname or IP address of another Linux box if you will be logging in as root or type if you will log in as another user, just like at the screen.Īfter you hit return, you will most probably be prompted that the authenticity of the host you’re trying to connect to cannot be established. We will be shown a window prompting for machine name. Let’s go to Right-Shell link as shown on the screenshot below: We need to establish an SSH connection to Another server in order to do this. I will continue with Windows screenshots, though it is much better to run it in Linux.
Ssh copy a file install#
If you don’t have it installed you should run yum install mc to get it.
Ssh copy a file how to#
I will show you how to establish a SSH connection to another server in this post.įirst of all let’s start midnight commander from command line by typing mc. I think that the most useful tools for this is Midnight Commander ( mc). If you are a system administrator, you should often need to copy files between servers.
