How to access files in var?

3

I want to copy var/log/installer to my Windows computer. I can copy from other locations, but not from this one. This is the error I get in Nautilus.

  • Error while opening file: permission denied

It does create the installer folder on the Windows computer, and a few files are copied. But the majority of the files contained within that folder, or one of its subfolders, are not copied. It appears that these files are protected, I noticed that most of the files have an X on their icon. This indicates the lack of permission in GNOME? I had a look at the properties for one of them and there is nothing I can change there.

So my question is, how do I get access to these files? How do I elevate my permission level? Can I start Nautilis in an elevated mode to get around this? Sort of like "run as administrator" in Windows?

I'm assuming that this has something to do with the "root" user account I had to create during installation, but I wouldn't know how to use it. Linux is not my domain.

Addendum

  • I am the owner of the computer. I installed Debian 7.2.1 Wheezy on it yesterday.
  • I had some problems during the installation, and I was offered to save a screenshot of each screen throughout the whole installation process. These screenshots were stored in the above mentioned location. I wanted to review these, now that the installation has completed.

Samir

Posted 2013-09-30T14:12:26.603

Reputation: 17 919

Answers

3

From Linux, run in the Root Terminal:

mkdir -p /home/sammy/Desktop/installer

sudo cp --no-preserve=mode,ownership,timestamps -R /var/log/installer /home/sammy/Desktop/installer/

chown -R sammy /home/sammy/Desktop/installer

Then, from there, you should be able to copy over to your Samba Share.

Kruug

Posted 2013-09-30T14:12:26.603

Reputation: 5 078

There is a "Terminal" and a "Root Terminal". Can I use either one? – Samir – 2013-09-30T14:35:55.317

Given the choice, Root Terminal would be the one you are looking for. You then could forgo the sudo. – Kruug – 2013-09-30T14:36:31.927

OK. So I click "Root Terminal" and type in the password, and choose to save it for the duration of the session. It says "Terminal (as superuser)" in the title bar. Then I type in nautilus and hit Enter. The Nautilus window comes up, and then it gave me some weird error which I just closed down on. When I repeat the procedure it doesn't come up again, so I don't know what it said the first time. So now when I go to /var/log/installer I can read and open all of the files, so that's good. But I still can't copy the "installer" folder to Windows computer. Still same error ("permission denied"). – Samir – 2013-09-30T14:57:42.943

Can I have more than just 1 Nautilus window? When I start "Root Terminal", run nautilus, and then start "Root Terminal" again and run nautilus it gives me some error. It says "could not parse arguments: cannot open display:" What gives? No more than 1 Naturilus window at the time running as root/superuser? – Samir – 2013-09-30T15:02:12.350

Also, if I close everything down, and start all over cleanly. If I then start "Root Terminal" and type nautilus and Enter, and then go to /var/log/installer and open one of the screenshot (PNG) files I get a warning in Terminal for each file I open. (nautilus:5715): Gtk-WARNING **: Attempting to store changes into /root/.local/share/recently-used.xbel , but failed: No such file or directory All the lines are similar, except some start with (eog:5715). What's up with that? – Samir – 2013-09-30T15:07:26.613

You may be running into permissions errors on the Windows files/folders. Your best bet may be to copy to a USB drive, then boot into Windows, and then copy the files back off of the drive. – Kruug – 2013-09-30T15:11:31.550

I want to try your command while in "Terminal (as superuser)". But I'm not sure what my remote path would look like. I don't think it's mounted. Does sudo cp -R /var/log/installer/ /192.168.0.103/c$ look right? – Samir – 2013-09-30T15:11:56.143

I have no problems accessing smb://192.168.0.103/c$ from Nautilus (Go, Location). I can drag and drop files between 192.168.0.103 and my local Desktop folder. I was playing around with a 570 MB file, transferring it back and forth to see what my network speed is like. There was no problem. You still think this might have to do with Windows permissions? – Samir – 2013-09-30T15:13:45.137

Ok, then what you'll want to do is, from the Root Terminal do cp -R /var/log/installer /home/<user>/Desktop/installer/ (you may need to create the installer folder on your desktop first). Then, once that is done, copy it over to the SMB share. – Kruug – 2013-09-30T15:18:33.460

There may be a more elegant way of doing this, but that should at least get the job done. – Kruug – 2013-09-30T15:18:51.430

let us continue this discussion in chat

– Samir – 2013-09-30T15:41:44.397

2

Can I start Nautilis in an elevated mode to get around this?

Just run gksudo nautilus. You will be operating with root privileges in the new window that opens.

slhck

Posted 2013-09-30T14:12:26.603

Reputation: 182 472

By "run" you mean the "run application" dialog box (Alt+F2) right? Well, that's what I do anyway... and when I do that, it prompts for password. "Enter your password to perform administrative tasks". I provide the password for root and hit Enter. The dialog disappears but no new Nautilus window is open. What gives? – Samir – 2013-09-30T14:25:39.260

@Sammy Are you in the sudo'ers group? At the terminal, type in groups. – Kruug – 2013-09-30T14:27:37.447

@Sammy Hm, that's precisely what you should have done. You can also call it from a terminal to see what the problem is. If you're not a sudoer, Kruug's method won't work either. – slhck – 2013-09-30T14:28:17.323

I noticed that while I was typing in "gksudo" that the icon on the left of the input field changes from the grey gears icon to a red prompt like icon. That happens when I'm at "gksu". So if I type gksu nautilus and hit Enter I get somewhat different prompt with more options. So which one do I use? – Samir – 2013-09-30T14:29:23.563

@Kruug If I type groups and hit Enter I can see my own name on a new line, at the beginning like "sammy cdrom floppy audio dip video plugdev scanner bluetooth netdev". Is that OK? – Samir – 2013-09-30T14:33:45.617

It appears that you are not in the sudo'ers group. – Kruug – 2013-09-30T14:37:35.993

@Sammy If you're not in the sudo group you will not be able to run Nautilus as root, and you cannot read the files either. This means you need the system administrator to give you root access to the machine, and add your user to the sudo group. – slhck – 2013-09-30T14:38:01.073

I tried gksudo nautilus from Terminal. This is the funny message I got. (gksudo:5480): Glib-CRITICAL **: g_str_has_prefix: assertion 'str != NULL' failed. – Samir – 2013-09-30T14:41:21.747

@Sammy are you the owner of this computer? – Kruug – 2013-09-30T14:45:02.387

@Kruug Yeah, I installed it yesterday. Debian 7.2.1 Wheezy. – Samir – 2013-09-30T15:08:43.180

@slhck "Unlike the su command, users typically supply their own password to sudo rather than the root password." Could this be something? I mean I was providing the password for root when I used gksudo nautilus and not the password of the user currently logged in. Is this why it didn't work?

– Samir – 2013-09-30T15:21:18.927

Ah, yes. When you sudo, you should be putting your own password in. When using su, that's when you would use the root password. – Kruug – 2013-09-30T15:36:07.163