downloading file using scp command
Just add where you want it to be copied to (ie: ./
):
scp [email protected]:/root/pcfilename.rar ./
First of all, make sure that the root user is really needed to access the file. If the file can be retrieved by a normal user, that would be preferred to limit the security risks.
If root is really required, make sure that root is actually allowed to login by ssh by checking your /etc/ssh/sshd_config
file and see if the PermitRootLogin
option is set to yes
.
Finally, your command above should work when you add a .
(pointing to your current dir) behind it, like so:
scp [email protected]:/root/pcfilename.rar .
Or you can always use a full path as well:
scp [email protected]:/root/pcfilename.rar /home/user/pcfilename.rar