Remember back in the days of MS-DOS, a file could have 4 different attributes: archive, read-only, hidden, system. As you know, MS-DOS didn't have any user rights or privileges. Files had no owner. If you were at the command line, you could do whatever you wanted, you could change or delete any files you wanted to... so long as they weren't read-only. Under MS-DOS, if you had a read-only file and tried to delete it, you would get an error saying "Cannot delete read-only file". There was a simple remedy to this, just turn off the read-onlyness:
attrib -r hello.txt
The point I'm trying to make here is that even though you had full permissions over the file, you still had to turn off its read-onlyness before you could make a change. Well I'm trying to do something similar in Linux. Under Linux, the root user has full permissions over every file. But I need to make a particular file read-only so that not even the root user can alter it. I have a few programs on my computer that need to be run as root because they do some low-level networking (raw sockets and the like), and these programs alter my "/etc/resolv.conf" file. Well I need to find a way of making my "/etc/resolv.conf" file READ-ONLY, even for the root user. It doesn't seem as though the Linux filesystem provides a means of doing this, reason being that the root user will always be able to alter any file it wants to. I was thinking though... there's some way I could turn my "/etc/resolv.conf" file into a virtual file of some sort, like maybe I could use some sort of mount program to mount the file as read-only... ?
I need to edit a line in a file in gedit, but its read only. I need to change
; default-sample-rate = 44100 to default-sample-rate=44800.
Would anyone know if there is an option to make a read only file editable? Judging by the responses to the thread I followed to enable my soundcard, it is possible, and perhaps there is some setting etc that needs changing
I am trying to edit my grub.conf file. I am logged in as root. It says it is a read only file. I have tried to set permission with chmod 777 and also tried through GUI. Using VI it says it's a read only file. Using nano it will not write either. I have two choices on boot up. I want to automatically go to second automatically. First at the moment is CentOS-4 i386 (2.6.9-55.ELsmp) and second is CentOS-4 i386 (2.6.9-55.EL).
I want my samba to keep my windows attributes exactly what the user setted in windows I mean if it has read only file in win box and copy it to samba share ,samba keep it read only and same for other attributes but it does not do it now with my configuration:Quote:
[global] workgroup = DOMAIN server string = File Server
and I have share1 and its subfolder " subshare " the thing i have to do is that, i have 2 assign user1 and user2 to share1 that means user1 and user2 can only access share1 through password and user3 can access only its subfolder "subshare" i have done this upto first level permission of share1 not able to do for its subfolder "subshare"
What are the possible problem when Windows access the file from Ubuntu got Read Only even though have a full permission to read, write and execute the file? Ubuntu to Ubuntu accessing the file there is no problem only Windows got a problem.
I need to create a startup file. As far as I've been able to find out the best locations to do this are the /etc/init and /etc/init.d directories. Two questions about that:
1) Can I just make blahblah.conf file in one of these directories and then it will be automatically read at boot-time or do I need to create a line that directs to the right file and location in again some other file?
2) Does it matter which of the directories (init of init.d) directories I use, ie., what's the difference?
I have a computer running Fedora 11. I wanted to use samba in my office. So I configured the /etc/samba/smb.conf ,but it did not work well : Windows can find samba,but when I tap in username and password,samba request them again , and the same thing continues in a loop. So I copied another computer's smb.conf (which is also a Fedora 11,samba runs well in this one).I copied this file to /etc/samba/ ,then samba can't satart up . I read from /var/log/samba/log.smbd.log : Unable to open configuration file "/etc/samba/smb.conf": Permission denied Even if I use: chmod 777 /etc/samba/smb.conf
why I can't login samba from Windows:
[global] workgroup = MYGROUP server string = Samba Server Version %v ; netbios name = MYSERVER ; interfaces = lo eth0 192.168.1.99/24
How to copy a Read-Only file in Linux and make the copy writable with a single cp command in Linux (Ubuntu 10.04)? The --no-preserve and --preserve seemed to be good candidates, except that they should "and" the mode flags, while what I am looking for is something that will "or" them (add +w mode).
More details: I have to import a repository from GIT to Perforce. I want that all Perforce depot files are Read-Only (that is how Perforce was designed), while all other files that were derived/copied from depot files are writable. Currently if a Makefile tries to copy a Read-Only file then the derived file will also be Read-only. This leads to build-errors when cp tries to overwrite Read-Only file second time. Of course the --force is a workaround here but then the derived file is also Read-Only. Also I do not want to mess with "chmod" after each "cp" command - I will do that only as the last resort.
I am using kubuntu 9.10 64-bit on AMD M500 machine i removed networkmanager (because i had frequent disconnect) and installed wicd but the /etc/resolv.conf had a comment on top which says that it is to be configured by networkmanager (still) I put the DNS in there manually and it works What to put in there so that it uses DHCP ? Maybe its set to be not written by anyone other than networkmanager ??
I'm using 9.10 Ubuntu Karmic 64-bit (but same thing happens on my 32 bit VM on same PC).
My /etc/resolf/conf file is not updated with DNS information on first boot. The DNS information is in the /etc/network/interfaces file.
The trick I have to do every time I reboot the PC is:
Code: sudo ifdown eth0 && sudo ifup eth0
First off, why? Second how can I resolve this issue?
I have three NICs eth0 and 1 are normal LANs connected to the internet, but I choose eth0 as the primary. eth2 is a local private one. the DNS information from eth0 should be in the resolv.conf file but isn't. The file is empty at bootup, except for some comments instructing me not to edit this. After running the above sudo commands the file is properly updated and internet works.
Here's my /etc/network/interfaces file's contents:
Code: auto lo iface lo inet loopback auto eth0 #iface eth0 inet dhcp
we're about to migrate a set of workstations (ubuntu 10.04 LTS) to a new kerberos/LDAP setup. Basically, this requires the installation of some required deb packages and to copy some new .conf files over the original ones.We made a deb package having these "features":requires the needed other packages as dependenciesbacks up original conf filescopies the new conf files to the right places (i.e. /etc/krb5.conf,/etc/ldap.conf)The problem is: apt-get complains because the deb is "touching" files owned by other packages (kerberos, ldap, etc.). Therefore, the only way to skip this check is either to force apt-get to proceed or using the "replaces" directive in the deb control file, specifying the clashing packages. omething like this:
when I opened /etc/updatedb.conf it says there in the file that one should make ones own updatedb.local. But how, exactly? Presumably I create /etc/updatedb.local but what do I put into that? With all those $-signs I'm pretty much lost. Could anyone post his/her example of a PRUNE_FS statement or point me to some reference where I can read up on this
I installed Windows XP Pro and RedHat Linux Enterprise 5 on my PC for my purpose. The PC is used by other family members too and they need only Windows OS for browsing. It is becoming problem for them to reboot after the PC enters into Linux by default. I am still learning Linux and I want to edit the /boot/grub.conf file to make Windows as default OS to boot. The following is the content of my grub.conf file (FYI):
I'm looking for a way to have the access log for my nginx install scroll up the terminal as lines are added to the log. I think I need a command like cat access.log | diff but I'm not sure exactly what it should be.
I have a folder hierarchy with many sub-folder levels under a set of parent folders. Based on the application design and business use, files are written to different locations on a daily basis. I want to find out the last updated file in the folder structure and its location at any given time. How can I do that?
Can you make a symlink read only? I have about 100 users who all have a .login. They like to modify their .login, which is fine in most cases, but sometimes they do it wrong & it screws up a LOT of the things they are supposed to be doing. Because of this, I'm going to lock down all .logins & I thought, "wouldn't it be nice if we could modify one file & all users would get the modification?" So I'm currently testing having everyone's .login point to a central .login via symlink. It works fine, but it appears that the users can [re]move the link & replace it with a file, thus defeating the purpose. Can I lock down the symlink so the user cannot move or remove the link? FWIW, it must be a symbolic link (as opposed to a hard link) as the file it points to is on an NFS share (not the same file system).
I need to change a filename but when I boot up I get the message root device is read-only. Is there a way of changing this so that I can change the filename. I have a Mac Pro running Leopard OSX. The graphics card an NVIDIA 7500GT or driver has failed. It was suggested elsewhere that I change the relevant kext files to filename.kext.old, which I did, now when I try to boot start in OSX I get a message in various languages telling me to restart. I have tried booting in safe mode and from original Installation CD. In Safe Mode I get the same multi language splash screen, from CD I still have the graphic card problem, screen freezes and artifacts appear. So I boot up straight into CLI by holding down CMD-S hoping to be able to change filenames back but it says device read-only.