How to commit changes to a remote file on a server

Task: To configure spark-defaults.conf and spark-env.sh file on a remote server using WinSCP

Error: Each time I try to commit changes to the file i keep getting the error "cannot overwrite remote file Permission denied Error code: 3 Error message from server: Permission denied"

Solution:

In Putty navigate into one directory before the actual directory
Example: I wanted to edit spark-defaults.conf file located in

/opt/cloudera/parcels/CDH-5.4.2.1.cdh5.4.2.p0.2/etc/spark/conf.dist/spark-defaults.conf

So what I did was I cd into /opt/cloudera/parcels/CDH-5.4.2-1.cdh5.4.2.p0.2/etc/spark
Next type the command sudo chown username:username directoryname -R
example: sudo chown ashish:ashish conf.dist -R

Now go into WinScp and edit the file ..Notice when you save the file the WinScp screen will flash kind off, indicates change has been comitted. you can check the same by opening the concerned file.

Reference: http://stackoverflow.com/questions/25505652/permission-denied-error-code-3-error-message-from-server-permission-denied-fi

Advertisements