Scp dev null permission denied
Nothing that I have tried so far has worked; every time I try to transfer my file from one of my servers to the other it asks for a password and it always says permission denied and before you ask I've checked the password many times maybe there is a different password for the root account. I'm already pretty sure it's because the file is in root but I don't know how to fix it, the file has to go into.
Does any one know how to transfer the file to the root file? Here's the code I'm using The Ip and computer names have been changed.
You say you've tried everything, but the example you provide is giving a very long path to the file. If that fails, you can't transfer it as the user you're logged in right now. If you can change your user to the owner of the file or to root, you will probably have better luck.
If you can't write to that location as the target user, you won't be able to copy the file there. If the redirect to the file failed but ls still listed a file, you may need to delete that file before you can copy this new file to that spot.
Or maybe you need to give it a new name why you copy it. Assuming that both of the tests above succeeded, but the scp is still failing, then take a look at the output from. If that is the case, why did the answers to this question suggest echo? For the ways to fix this see shantanu answer. Sergey Sergey 42k 11 11 gold badges silver badges bronze badges. PanosRontogiannis: thanks, I've updated the answer — Sergey. Eliah Kagan k 51 51 gold badges silver badges bronze badges.
Untitled Untitled 1, 2 2 gold badges 11 11 silver badges 15 15 bronze badges. Another option is to use a temporary file. This is useful in a bash script. Works because sudo forwards stdin to the command. This is good. Like sudo tee , sudo dd will of course also work with here strings , e. NB with sh -c 'cmd' , sh is a subprocess that's a shell, but not really a subshell except in the sense all external commands begin as one.
Seamus Seamus 1 1 gold badge 3 3 silver badges 13 13 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Active Oldest Votes. This must be used when ssh is run in the background. A common trick is to use this to run X11 programs on a remote machine. For example, ssh -n shadows. The ssh program will be put in the background. This does not work if ssh needs to ask for a password or passphrase; see also the -f option.
Or even on -N -N Do not execute a remote command. Note that the question is about redirecting standard and AFAIK your answer is about redirecting standard input. Michael Krelin - hacker Michael Krelin - hacker k 22 22 gold badges silver badges bronze badges. Stephane Rouberol Stephane Rouberol 4, 17 17 silver badges 18 18 bronze badges. Levon Levon k 32 32 gold badges silver badges bronze badges. Create a Post. Turn on suggestions.
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. Showing results for. Search instead for. Did you mean:. Sign In Help. Labels Labels: SmartConsole. Tags: management. All forum topics Previous Topic Next Topic. Accepted Solutions.
PhoneBoy Admin. Me too.
0コメント