-1

I have uploaded a file to a remote Linux server.

current directory is: /home/user/file.war

Now i want to move the file into tomcat webapps folder and overwrite the existing version:

The directory I want to move it to is: /var/lib/tomcat8/webapps

I tried it a few days ago using PuTTY, change to root user like this:

sudo -s

It asks for my user password and then as root i tried to copy the file with one of the following commands:

scp file.war root@ip:/var/lib/tomcat8/webapps

sudo scp file.war root@ip:/var/lib/tomcat8/webapps

scp /home/user/file.war root@server:/var/lib/tomcat8/webapps

Then it asks for my password again, but I only get a "Permission denied". The password seems to be alright, because otherwise I could not have logged in in the beginning. What am I doing wrong here?

Is it possible to get root access only with WinSCP? Logging in with sudo shell didn't work for me either...

1 Answer 1

1

You want to copy a local file to another local directory.

So you want the plain cp, not the scp.

cp /home/user/file.war /var/lib/tomcat8/webapps

Regarding WinSCP: See FAQ How do I change user after login (e.g. su root)?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .