Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to copy a log file from a Amazon EC2 instance to my local machine (Windows 7). I am using WinSCP438 which is able to connect to the remote server i.e Amazon EC2 instance. I am trying to access the instance as root user in WinSCP using the method described here but I am getting an error shown in below image

enter image description here

My question is why I am getting this error and how to copy the file from remote server i.e Amazon EC2 to local machine/

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Instead of trying to access the logs as root user, it may be simpler to change the permissions on the server to grant access to the ec2-user. This can usually be done with the commands chown and chmod, but the exact steps depend on the way your server is set up. If you need help to do that, you can post the output of the following commands and I'll try to help:

sudo ls -ld /var/log/tomcat7
id

Edit: Ok based on your output bellow, what you could do is change the group of the log directory to tomcat (instead of root) and then add the ec2-user to the tomcat group:

sudo chown -R tomcat:tomcat /var/log/tomcat7
sudo usermod -G ec2-user,wheel,tomcat ec2-user

Then you must log out and log back in for the new group membership to apply.

share|improve this answer
    
sudo ls -ld /var/log/tomcat7 -> drwxrwx--- 2 tomcat root 4096 Jul 4 12:01 /var/log/tomcat7 id -> uid=222(ec2-user) gid=500(ec2-user) gropus=500(ec2-user), 10(wheel) –  Gaurav Agarwal Jul 4 '12 at 17:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.