New answers tagged

0

To map from the host argument given on the command line to the ssh_config hostname entry is easy using ssh itself. You can ask it to evaluate and print out what it would use for the configuration for a command line, without actually connecting. Then you simply need to pull out what it lists for hostname (Note that it canonicalizes configuration key names by ...


1

There are two interactions here. First SSH asks to confirm the server's identity. This is necessary because an adversary might impersonate the server, to tick you into logging in and providing your password or other confidential data. The first time you ever connect to a server, you need to verify the hosts's identity. After this, SSH remembers the ...


0

Yes. indeed, just establish password-less ssh authentication first, between the two communicating machines by using the ssh-keygen and ssh-copy-id commands. You ll be good to go. Follow-these-steps


0

to avoid the repeated password prompts, use key-based authentication rather than password-based. e.g. run ssh-keygen on your local machine and then run ssh-copy-id user@remotehost for each remote host. That'll be the last time you need to enter the password when you ssh or scp from that machine. Use a good pass-phrase on your key and run ssh-agent or ...


0

Separating the command using ; worked. ssh $USER_ID@$DESTINATION_SERVER "mv /source1/* /destination1/; mv /source2/ /destination2/; ......"


1

You can't have multiple destinations in one scp command. If you want to make a single SSH connection, you'll need to use some other tool. The simplest solution is to mount the remote filesystem over SSHFS and then use the cp command. This requires SFTP access. mkdir host_server sshfs username@host_server:/file host_server cp /file/source1/* host_server/...


0

I could get this to work on my box, but I'm not sure if sudoers option requiretty would break it. On machine B create program that sudo will use to ask for passwords. e.g. /home/myname/askpass.sh, chmod it +x #!/bin/bash echo "my_password" On machine A create connect script that will establish the ssh connection for the scp and inject sudo + related ...


1

scp uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Unlike rcp, scp will ask for passwords or passphrases if they are needed for authentication. So you can: 1. Settle ssh for connection via public key by editing remote sshd_config like # Should we allow Identity (SSH version 1) authentication? ...


2

It works the same way as the multi-hop ssh if you will use the ProxyCommand. The ProxyCommand is transparent regardless what you do above that. Host proxy Hostname proxy.tld User proxy_user Host target Hostname target.tld User target_user ProxyCommand ssh -W %h:%p proxy Then running scp file target: will copy the file over the proxy to the ...


1

Your machine hostname is not resolvable from the remote host. You should do this the other way round. From your local host: scp xyz@remote:/home/user/test /home/user Or the other way is to set up remote port forwarding, so you will be able to connect from your remote machine to your local host. Your command can look like this: [local] $ ssh -R 2222:...


0

If I understand your question, You are sitting in front of the mac and have a ssh into the debian. You see a file on the debian that you want on your mac. You do not want to 'pull' the file from the debian to the mac because you must switch terminals. Use scp to 'push' the file from the debian terminal. scp /local/file/on/debian mac_user@mac:/downloads /...


0

User Chris at Webhosting Talk writes: rsync compares the files at each end and transfers only the changed parts of changed files. When you transfer files the first timeo it behaves pretty much like scp, but for a second transfer, where most files are unchanged, it will push a lot less data than scp. It's also a convenient way to restart failed ...


5

Unix commands almost always (with very few exceptions) have source before target. And most allow multiple sources before the final target if it makes sense to do so. That includes scp. Some commands (like the GNU versions of cp and mv) have an option (e.g. -t or --target-directory=DIRECTORY) that allow you to put the target first - but the default is the ...


2

With the scp command, you can specify the source (the file or directory to be copied) and the target (the location in which to copy the file or directory). The syntax for scp is: If you are on the computer from which you want to send file to a remote computer: scp /file/to/send username@remote:/where/to/put Here the remote can be a FQDN or an IP address. ...



Top 50 recent answers are included