chmod 600 changed type of file to binary

Asked by gbonline

Hi, I'm following the instructions to install nginx and passenger on my ubuntu/unity 13.10 x86_64 machine as indicated on phusion site.
Then I need to create a file passenger.list into /etc/apt/sources.list.d and I do it with sudo nano /etc/apt/sources.list.d/passenger.list

The file I create on nautilus is showed as text file!
After in the instructions, I need to do the commands
$ sudo chown root: /etc/apt/sources.list.d/passenger.list
$ sudo chmod 600 /etc/apt/sources.list.d/passenger.list

and after the last command on nautilus, I see that the file is a binary file!

this kind of file 'binary' cause an error when i need to use the apt as
WARNING:root:could not open file '/etc/apt/sources.list.d/passenger.list'

chmod doesn't change the file type, right?
G.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1279082.

Revision history for this message
John Kim (kotux) said :
#1

It wants to confirm that chown doesn't change filetypes.

Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#2

chmod 600 makes a file accessable to only root. The default when nautilus can't read the contents of a file is to declare it as binary. chown root:root has the same affect. Your file type hasn't changed nautilus just can't fead it.

Hamish

Revision history for this message
gbonline (gbonline-6) said :
#3

Thanks for the replay, I understand now that the file type isn't involved in the error.
But what about the Warning on accessing files used by apt?
If i call a sudo apt-get update I get the error that some problems occours

All the files in sources.list.d folder and sub, are owned by root, so if on ny new passenger.list file I change the owner that should not provoke a warning.
I submitted this as bug because the same installation on debian 7 desktop has been done without any errors/warning.

To resolve the issue now I didn't changed the the mod on that file.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

What is the output of
ls -l /etc/apt/sources.list
ls -l /etc/apt/sources.list.d

The additional source list files on my system are protected -rw-r--r--
So I recommend
sudo chmod 644 /etc/apt/sources.list.d/passenger.list

(I do not see any security implication by showing the sources where you download programs, as long as there is no write access to these files for ordinary users.)

Can you help with this problem?

Provide an answer of your own, or ask gbonline for more information if necessary.

To post a message you must log in.