I'm currently logged onto my remote server and I need to transfer a file from my local machine to my remote server using SCP but it doesn't seem to be working. I was able to do it using SFTP but I don't know why I am having such a difficult time with using SCP.
In my terminal shell, I ssh'ed into a remote server, and I cd to the directory I want. Now in this directory, there is a file called table that I want to copy to my local machine /home/me/Desktop. How can I do this?
The scp operation is separate from your ssh login. You will need to issue an ssh command similar to the following one assuming jdoe is account with which you log into the remote system and that the remote system is example.com:
The scp command issued from the system where /home/me/Desktop resides is followed by the userid for the account on the remote server. You then add a ":" followed by the directory path and file name on the remote server, e.g., /somedir/table. Then add a space and the location to which you want to copy the file. If you want the file to have the same name on the client system, you can indicate that with a period, i.e. "." at the end of the directory path; if you want a different name you could use /home/me/Desktop/newname, instead. If you were using a nonstandard port for SSH connections, you would need to specify that port with a "-P n" (capital P), where "n" is the port number. The standard port is 22 and if you aren't specifying it for the SSH connection then you won't need that.
When you use scp you have to tell the host name and ip address from where you want to copy the file. For instance, if you are at the remote host and you want to transfer the file to your pc you may use something like this:
I have a remote access to remote server from my university and I'm accessing it through my local machine! However, my local machine has not enough memory to run multiple jupyter notebooks. Is there any way to run them through the remote server, which probably speed up tasks!! I'm not quite sure though!
Let's assume that the local user localuser and host as localhost, the remote user and remote host as remoteuser and remotehost. To run a Jupyter notebook on remote server from your local machine you can follow the steps below.
To access the remote machine with a browser the notebook must listen on an external facing port (not localhost). You will need the same invocation if want to run the Jupyter notebook on a container. In that case it is something like this:
To access remotely the ssh tunnel option in other answers works. You will need an SSH tunnel per notebook. If you need to run multiple notebooks, another option is using the sshuttle tool to simulate a VPN over SSH so you don't have to create multiple tunnels. Run sshuttle with the option to have full reachability to the network of your remote machine (e.g. 10.250.100.40/24) or you can run it to forward all the traffic through the remote machine (like a traditional VPN).
I think it is better to copy files from your local computer, because if files number or file size is very big, copying process could be interrupted if your current ssh session would be lost (broken pipe or whatever).
I want to establish a connection to a remote server from my Mac using SSH. So far so good.Now the tricky bit, with the connection to the remote server established I want to then initiate a connection from the remote server BACK to the local machine. I know, crazy. Basically I need to jump through these hoops to be able to browse the remote server and then send file information back to my local machine so it can be dealt with by an application on the local machine. Hopefully that makes sense!
Things I have established:I'm on a Mac(OS X 10.6.4) and I have Remote Login enabled in system preferences/sharingIf I try and SSH into my mac from another machine on out LAN I can connect no problems.If I try and SSH into another server (not my local machine) from my remote server, I can get connected up with no problems.
If when you connect back to your local it allows you to login before hanging, then this isn't the answer. If you don't get that far, you're probably not getting back to your Mac (either not getting anywhere or hitting SSH on a gateway). Try a reverse tunnel (it will require GatewayPorts set to On in sshd_config on your server, but I believe this is default):
you@yourMac$ ssh -R 2000:localhost:22 user@remoteserver
That should allow you to connect to the server as normal, but also open a tunnel so that you can connect back on port 2000 (any port over 1024 should work), so you@yourserver$ ssh -p2000 user@localhost
Is your local machine accessible from the server? Can you ping it? I'm asking that because what you are doing should work if your machine is accessible. Your server is on internet or in LAN, same subnet?
Anyways if you only need to edit a file, why don't you simply use scp to copy the file to your local machine? You can use ssh to browse for the file on the remote server and when you have its path, enter in your local machine (in another terminal):
This above is if you need to access it in terminal. On linux (and certainly on Mac but I don't know how to do it), you can mount an ssh remote location in Networks and use the connection as you use a local disk (this is sftp and the connection is in the form: s @server:/path/to/mount and I guess this is what you need instead of a remote terminal connection so you can edit the file directly with the Mac application.
You may also want to take a look a sshfs (you need MacFuse for this). This allows you to mount directories on the remote machine and access them just like regular folders on your machine. On top of that, you could still ssh into the machine and create/search the files you need. Transferring them would then be as easy as transferring local files.
So how do you test this? My server is headless, so I have to ssh to it but then I can't ssh or use any of the tools that work on ssh to connect back to my workstation. The reverse tunnel fills the bill. Another option is to run the test using the at command then drop the tunnel before the job kicks in. Both are somewhat clumsy but the reverse port is both easier and more flexible. Plus I already use the local port forwarding to build VNC tunnels to other computers.
This will depends on what your local system is running, and how you can access the data on the remote system. If the data can be accessed on your local system via a Windows share (SMB), then you can just run a local version of mrview and load the data from that network drive.
What would be the best way to achieve this goal? Install Qupath on the Server and try to run it there? Or can I also access the files stored on the remote server from my local machine using Scripting and Qupath?
It occurred to me that maybe there would be a way to run an emacs server on the instance and have some kind of a thin client locally. I messed around with forwarding the server socket over ssh, but it turns out that emacsclient will just try and get the server to do stuff on its end. In other words, emacsclient is just an RPC call, not a thin client.
I am currently working on a script that checks the expiration date of an RDS cert, then creates the Request for a new one. I am able to copy everything to the remote servers that i need to use but when i try to copy back the output file for the request I get an error "Copy-Item : A parameter cannot be found that matches parameter name 'FromSession'." I've tried using New-PsDrive but I wasn't able to get that to work either. I can either use a network share, or a share on my local machine for the file to be copied back to. Any help would be great or pointing to a source.
from the remote server if i use, where S:\ is a mapped drive to the location i want to save to It works with the wildcard but i get "Copy-Item : Cannot find drive. A drive with the name 'S' does not exist." when trying to use in from my local machine
correct im trying to copy an output file from the remote server to my local or shared network drive in order to get the cert request from each server in one place without rdping to each server.. I will try that now
I tried that as well when I tried invoke-command. same issue. I am running powershell on my local machine as 1 user, still admin, then on the server i am using my server admin account which are the credentials I am passing through.
For example, the following command will attempt to copy the [.inline-code]index.js[.inline-code] file located in the [.inline-code]/home/john/app[.inline-code] directory on the remote server to your home directory on your local machine using the [.inline-code]johndoe[.inline-code] account.
I have been running my code within a screen session on a remote server. I want to move the output directories generated within this session on the remote server to my local server using SCP but I am not able to.
Explanation: When you log into the remote machine, you end up in your home directory. This is most likely /home/username (where username is your username). In your home directory, you have that media subdirectory.
The other thing to try is to execute scp on the remote machine to transfer the file to the local machine. This would obviously only work if you are allowed to log in locally from that machine using SSH.
Diwakar, you need to install Percona Xtrabackup on the remote node 192.168.0.200. Then connect to that node from 192.168.0.100 for example in my case I have nodes 192.168.0.106 and 192.168.0.107:
I execute everything in node1 (192.168.0.106):