Last active
January 26, 2018 06:17
-
-
Save GitSumito/bc8d6c52bb5e282814fb5795df5a598e to your computer and use it in GitHub Desktop.
scpでPermission deniedになるファイルを無理やり転送する ref: https://qiita.com/S-T/items/fc9f34da43d6e80ad501
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ scp TargetServer:/tmp/sample /tmp/sample | |
scp: /tmp/sample: Permission denied | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh TargetServer "sudo cat /tmp/sample" > /tmp/sample | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh TargetServer "sudo dd if=/tmp/sample" | dd of=/tmp/sample | |
0+0 レコード入力 | |
0+0 レコード出力 | |
0 バイト (0 B) コピーされました、 3.3649e-05 秒、 0.0 kB/秒 | |
0+0 records in | |
0+0 records out | |
0 bytes (0 B) copied, 0.212011 s, 0.0 kB/s | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh TargetServer "cat $remoteFilename" | sudo diff - $filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh TargetServer "cat /etc/logrotate.d/test" | diff - /tmp/test | |
6,8d5 | |
< #added | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment