Tag Info

New answers tagged

0

C:\Users\ching\proj\fdGlIfFix\src\BP>pscp PS104T ching@moscow_host:/home/ching/tmp/ ching@moscow_host's password: PS104T | 44 kB | 44.4 kB/s | ETA: 00:00:00 | 100% C:\Users\ching\proj\fdGlIfFix\src\BP>pscp -i c:\users\ching\random.ppk PS104T ching@moscow_host:/home/ching/tmp/ PS104T | 44 kB | 44.4 kB/s | ETA: ...


0

Typing out me@host twice can be irksome. This is what is ssh_config for. You can store username and alias for your host: Host short Hostname host User me which will save you typing and you end up with only scp file short:path; ssh short. Probably not the answer you are searching, but there is automatic completion much less hack then alias or ...


1

Write yourself a script - e.g.: #!/bin/bash src_file=$1 dst=$2 test -n "$src_file" || exit 1 test -n "$dst" || exit 1 dst_login=${dst%%:*} if scp $src_file $dst; then echo echo "scp succeeded, starting ssh session ..." ssh $dst_login else echo "scp failed. Not stargin ssh session." exit 1 fi Save the above into a file, make it ...


0

ssh to host used in previous scp command Well, since per your comment storing me@host in variable is out1; we'll have to do it another, cleverer way: $ scp somefile me@host:/some/path $ ssh "${_%%:*}" This will ssh you to me@host. Explanation $_ recalls the last argument to the previous command. The %% construct deletes the longest match from the back ...


0

Try installing OwnCloud utilizing SSL/TLS it actually uses WebDAV and complies with all your requirements.


0

While Felipe has the best answer for a bash only solution, I think that Ansible is far superior for this task. You simply need to put all of your servers into an inventory file like this: [default] firstserver.com ansible_ssh_user=firstuser secondserver.com ansible_ssh_user=seconduser thirdserver.com ansible_ssh_user=thirduser And a playbook ...


0

Try this: a@A:~> ssh-keygen -t rsa a@A:~> ssh-copy-id b@B a@A:~> ssh b@B If ssh-copy-id is unavailable, use this: a@A:~> ssh-keygen -t rsa a@A:~> ssh b@B mkdir -p .ssh a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys' a@A:~> ssh b@B To end a session, use the exit command.


1

If you are running ssh on non-sandard port, you need to specify it using -P option. Also if you want to sopy folder, you need to do it with -r option, so it will dive into subdirectories. scp -r -P 9311 /home/web/domains/site.com/public_html/sql/months \ root@54.84.145.22:/home/web/domains/site.com/public_html/sql/months2 To make sure service is running ...


-1

There is problem with : in scp commands on windows. You can workaround it using: cat /var/www/joomla/sql/rt_head_includes.php | ssh root@202.xx.xx.xx cat D:\mydocument which is basically the equivalent using pure ssh. But make sure you have set-up passwordless authentication or control master, otherwise it will fail.


2

Use WinSCP tool. Works like a charm.


0

AFAIK, this might work if your windows machine runs ssh server. Does it? If not, you might need to use something like winscp on that windows machine. Not sure if you can script winscp. Besides that, when dealing with windows paths you need to escape backslashes.


3

If you want to stay in bash-only domain: while read server scp thisfile.sh $server:/some/location ssh $server /some/location/thisfile.sh done < servers.txt This will prompt execute one work at a time, and ask you for authentication when needed


0

There are a few ways that you could accomplish this. You can use something like ansible or fabric to write a script that will connect to all of your computers and copy the file to them and run the script. or you can write a bash/shell script to copy the files up there and then run the script. Fabric and Ansible have a slightly higher learning curve but can ...


1

Try this from your host: scp -P 2222 vmuser@vmhost:/vmfilepath/myfile2.csv myfilepath/



Top 50 recent answers are included