Access denied viewing log files SSH/PuTTY

Get a Permission Denied on the “/var/log/user.log” but I can view the list of log files so it appears that some changes must be made first.

I found this post:  http://ubuntuforums.org/showthread.php?t=2247237.  Is this pretty much correct?  Seems like a long haul!  Is there a tutorial posted here?

Are you doing an ssh to the device and logging in as root?  If so you should not get an access denied.  The permissions

on the /var/log/user.log file is 644 or rw-r-r.  I can read the file as root or as a normal user.

RAC

rac8006 wrote:

Are you doing an ssh to the device and logging in as root?  If so you should not get an access denied.  The permissions

on the /var/log/user.log file is 644 or rw-r-r.  I can read the file as root or as a normal user.

 

RAC

Yeah, “root” and the default password of “welc0me”.  Didn’t try them all but three or four log files gave the same results.  

I don’t under stand why you can’t access the log files.  But you need to change the root password. 

RAC

I had to use a command like “cat” or “more -f” proceeding the “/var/log/user.log”.

I use more /var/log/user.log.  I also use tail /var/log/user.log.

RAC

 I had to use a command like “cat” or “more -f” proceeding the “/var/log/user.log”.

Yes; you will need to enter a command to copy the file to stdout, so more, head, tail or cat will be needed, or use an editor such as vi or nano.

If you simply type the filename, Unix will try to run it as a command, and give you ‘permission denied’.

Or did I misunderstand you?

Yes, I entered it just as “rac8006” actually posted it in another thread.  Maybe he “assume” that I knew what I was doing?  Wrong!!

I should have remembered this from some limited use with an Android tabs.

When you ssh into the device.  Enter the command id.  It should return “uid=0(root) gid=0(root) groups=0(root),33(www-data),1000(share)”  This shows that you are logged as root.  If you are logged in as root you should be able to view the user.log file.  You could also enter ls -l /var/log/user.log.  Which should return “-rw-r–r-- 1 root adm 156131 Mar 10 11:28 /var/log/user.log” The rw says that root can read/write this file everybody else can only read the file.

RAC

rac8006 wrote:

When you ssh into the device.  Enter the command id.  It should return “uid=0(root) gid=0(root) groups=0(root),33(www-data),1000(share)”  This shows that you are logged as root.  If you are logged in as root you should be able to view the user.log file.  You could also enter ls -l /var/log/user.log.  Which should return “-rw-r–r-- 1 root adm 156131 Mar 10 11:28 /var/log/user.log” The rw says that root can read/write this file everybody else can only read the file.

 

RAC

Yes, that all went as you described.

RAC, I think wptski was simply typing the filename, and, now that he is using a command to view the file, his problem is solved.

Is that correct, wptski?

Interesting.  I guess I missed the point where he was able to read the file? 

RAC

 I guess I missed the point where he was able to read the file?

There’s a distinct lack of clarity of expression on this thread, but that’s what I read into this comment:

‘I had to use a command like “cat” or “more -f” proceeding the “/var/log/user.log”.’

And why I’ve asked wptski to confirm…