Tag Info

New answers tagged

0

Try looking into controlmaster. It opens a single ssh connection, and allows future ssh and scp connections to go through the same connection, so there is no need to provide the password again, or wait for the connection to open. Here is an example of how to setup controlmaster. Edit your .ssh/config file to include the lines: Host hostname ...


0

If you have ssh access on the server, you could always use an sftp client like ExpanDrive to mount your remote home directory on your local machine. Then you can just write your script locally in a text editor and save it to the locally-mounted remote machine. At that point, it'll be on the server, and all you have to do is ssh into it and run it. As long ...


0

You can try something like: cat localfile | ssh <WORKusername>@<WORK> "ssh -p23456 <SERVERusername>@localhost 'cat > remotefile'"


2

Try to use this: scp -P SERVERPORT -o 'ProxyCommand ssh -p WORKPORT WORKUSER@WORK nc %h %p 2>/dev/null' localfile SERVERUSER@SERVER:remotefile ProxyCommand create the proxy on WORK host that connected to SERVER:SERVERPORT (see nc). %h and %p are ssh variables - target host and port respectively.


1

You can use tcpdump -lnXvv dst port 22. as root user. Following is a sample output: 15:52:01.257950 IP (tos 0x0, ttl 127, id 7254, offset 0, flags [DF], proto TCP (6), length 656) 172.17.27.130.52032 > 172.17.17.28.22: Flags [P.], cksum 0x9d77 (correct), seq 35152848:35153464, ack 16709, win 256, length 616 0x0000: 4500 0290 1c56 4000 7f06 5851 ac11 ...


1

scp is using the ssh protocol, so any scp will also be logged in /var/log/secure as an ssh connection. sudo grep sshd /var/log/secure |tail or journalctl /usr/sbin/sshd |tail However, you will not distinguish this connection from a SSH session on the same account.


1

Yes you can check the incoming connections by using below command. ps aux | grep scp You can also check the IP by using below command. scp use ssh to transfer files. netstat -plant | grep sshd


0

Make the big command in to script. Put execution permission. Then call it. sudo vim /usr/bin/mycommand and paste following content. date >> ~/$ scp shiv@127.0.0.1:~/Pictures/foobar.txt /home/shiv/Desktop/expc/ >> ~/shivraj.logs. Then make is executable. chmod +x /usr/bin/mycommand Then try this command is work or not with by typing it ...


0

You command is invalid. You need to seperate the different commands you want to run with a semicolon: */2 * * * * date >> ~/$; scp shiv@127.0.0.1:~/Pictures/foobar.txt /home/shiv/Desktop/expc/ >> ~/shivraj.logs (In addition, I'm not sure what you're trying to achieve, but you are writing the date to a file named $)


0

try scp in a fast way scp -C -o 'CompressionLevel 9' -o 'IPQoS throughput' -c arcfour machine:file . these options speed up scp 5 times in my setup compared to plain scp machine:file .



Top 50 recent answers are included