I just noticed on my Ubuntu machine (ext3 filesystem) that removing write permissions from a file does not keep root from writing to it. Is this a general rule of UNIX file permissions? Or specific to Ubuntu? Or a misconfiguration on my machine? Writing to the file fails (as expected) if I do this from my normal user account.Is this normal behavior?Is there a way to prevent root from accidentally writing to a file (Preferably using normal filesystem mechanisms, not AppArmor, etc.)
I understand that root has total control over the system and can, eg, change the permissions on any file.My question is whether currently set permissions are enforced on code running as root. The idea is the root user preventing her/himself from accidentally writing to a file. also understand that one should not be logged in as root for normal operations.
i have written some really basic loadable kernel modules. There are a couple of concepts that i'll like to get cleared.
In a tutorial, the Makefile was given as follows- obj-m += try.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
I understand that -C option of 'make' changes the current directory to /lib/modules/$(shell uname -r)/build (which depends on my kernel).
Now, my question is why to change to that particular directory? Also M=$(PWD) will hold the dir where i have written the module. Why is it required? What does 'modules' at the end of that line indicate?
Q2> We need to include <linux/module.h> and <linux/kernel.h> in a module. If i am right, the module uses kernel headers for these definitions. But how does 'make' find these definitions.
Q3> We are planning to write a custom scheduler for linux kernel. cat /sys/block/sda/queue/scheduler gives us the currently loaded schedulers. How do we expose our scheduler to linux kernel so that we can use it by switching to it.
I'm trying to write a simple, console based application in linux, in c++. I know how to start in Eclipse and I have some experience in c++ from Windoze. I would like to ask, if there is some tutorial available on writing console apps. I mean, I know from using linux that there are two conventions on using parameters in command line (-v and --version for example).
I'm currently doing a tutorial for writing kernel modules. Right now I'm still at the very beginning, i.e. writing my helloworld stuff.
But what I like to do now is to write stuff onto the console, and I don't get it. According to my tutorials I can print stuff on the console using the printk()-function as long as the priority-level of the macro used in printk() is lower than the console_loglevel (how can I find that value out btw?).
But it doesn't work for me. Even if I use KERN_EMERG it still gets only logged, but not printed on the console and I thought KERN_EMERG get always printed...
Here's my code:
Code:
Code:
Everything works fine. But as soon as there are any blanks in mystring, e.g.
Code:
I always get
Code:
Why do I get this error and how can I insert string with blanks?
I want to be able to access my email account from the console. I'm reading all day about fetchmail, postfix, sendmail etc. but all the stuff I found is related to building whole mail system. All I want to do is to read my emails and write some. Which is the painless way to do this? I successfully configured Evolution for this purpose but I want to do that from the console.
i play around with c for producing some io to a san-disk and struggle with basics here. :-(
if i'm using the write()-call to write 1 byte to a file on the disk iostat tells me i'm producing 3 writes. if i write 1 byte twice a second, it tells me i produce 6 writes (w/s).
I am trying to get Debian 7.4 to burn 50Gb Blueray disks for backups using K3b. The GUI based program is important.
The reason I am using Linux Kernel 3.12-0.bpo.1-amd64 is that I am running an i7-4770K CPU and the motherboard a Supermicro c7-z87-oce (NO overclocking) and 32G RAM. I have had no other problems since using the backported kernel and turning off the onboard graphics and using an nvidia G210 graphics card.
The Pioneer BDR-209M CD/DVD/Blueray burner reads CDs and DVDs to the extent I am able to install Wheezy, and then use a backported kernel. However, it will not write CD's, DVD's and it won't recognize Blueray disks.
I have spent some time weeding through conflicting information and I wanted to verify there is not a work around. I have downloaded and installed the current version of cdrecord to no avail. I have completely removed everything CD/DVD/Blueray related and reinstalled, also to no avail.
Then I came across this statement from: [URL] ....
In all programs of the fork that send SCSI commands, you may be unable to access any of the CD/DVD/Blu-Ray drives at all if you are on Linux-2.6.8.1 or later. This is due to a missing workaround for the Linux kernel interface change that happened with Linux-2.6.8.1.
i am working on this thread: [URL] if it is better to open a file every time i need to write to it or should i keep a file open the whole time and when i am done with the script, close it and sendmail it out?
Or i just thought of this: i could keep concatenating to a string and just sendmail when done.
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.
When I start the Jboss using the Jboss script run.sh, the console can not be used anymore and you have to stop it by opening another console. So I am going to write a script which calls up the run.sh and then get off the console so that this console can be used.
My script looks as follow:
Code:
#!/bin/bash $JBOSS_HOME/bin/run.sh exit
But it doesn't get off. I am sure it's missing some code.
My problem is extremely slow write on hard disk and 100% cpu usage and it happens when I want to write something on the hard derive not any other external derive.
Tried a fresh ubuntu install. No change. I am not even sure if it is a software or hardware problem.
I have setup my linux fedora server and i want to restrict access to my server.Basically i control using iptables.I'm not sure how to write an iptables rules to control drop all connection to port 8080 and allow only certain ip can access the instance on port 8080 example ip=10.254.14.16,192.168.1.10.
I was trying to write IPTABLES script to block the ICMP ping using the below mentioned command in OpenSUSE 11.2 Doing this in VMware.....
iptables -A OUTPUT -o eth0 -p icmp -j DROP
& then I tried to ping the different computer & it didnt allow me to ping. Then I deleted using the command -
iptables -D OUTPUT -o eth0 -p icmp -j DROP
then I couldnt ping also. Another thing I found is my firefox is not connecting to the internet as well, but before writing the script, I can connect to internet.
I am facing a strange problem witht my iptables as there are some firewall entries stored somewhere which is displaying the below firewall entries even after flushing the iptables & when I restart the iptables service then the firewall entries are again shown in my iptables as shown below,
I'm using fedora12 with KVM. I'm also using iptables for filtering and nat. Problem is when I start libvirtd, it overwrites my current iptables and iptables config file (/etc/sysconfig/iptables).
Ok it leaves an old copy in /etc/sysconfig/iptables.old, but the main problem is that it removes also all my custom settings from filter and my full nat. I would like the keep control on my iptables and like to manage them on my own. But I cant find an option in the libvirtd config files and/or the libvirtd startup scripts to prevent libvirt from changing my iptables. how I can make libvirtd stop tempering with my iptables?
I set up a squid transparent proxy and I have a problem with an iptable rules. I have a rule to redirect all request to port 80 to go on port 3128. To do so, I'm using this iptables command :
This command is working like a charm. The only problem is, for some unknown reasons, this rule will be dropped at some point. I did not manage to identify what is causing this to happen. It occurs during night, but I have nothing about that in my log files. messages / firewall / ...) The only way I managed to reproduce this 'dropping' is this one: I type the command like as root. The command is effective and working fine. I open yast, I go to the firewall module, the I do a simple "save changes and restart firewall" (without changing anything). As soon as this process is finished, the iptables rule is gone.
-How can I make this rule permanent ?
-Is there a place where I can launch a script executing this rule, after the yast firewall module is 'touched' or something ?
I am trying to make start an iptables.cf script on my server.
I have copied it into /etc/init.d/ And try to make it load with /etc/init.d/iptables.cf start Then "not permission" (I was the root then). So, sudo /etc/init.d/iptables.cf start Then, "command not found".
Have previously moved my ssh server from 22 to 4455 just by moving the port in sshd_config. This is done to minimize the log entries resulting from brute force attacks.However, it seems like Zimbra and other local services expect to find the ssh service locally available on port 22, so I figured it's better to move the port in the firewall so that it remains configured on port 22 in sshd_config, and instead use iptables with a nat/port rewrite to move 4455 incoming to 22 locally.
Isolated this works as long as I also keep allowing port 22, but the moment I close port 22, port 4455 is also dead, which sort of defies the purpose
I have a slight problem. Whenever I type something in rxvt, and sometimes it's a loooong something, I end up having to make it span multiple lines, as do you, probably. Anyway, my problem is that if I'm in any console at all, (aside from the TTY console and such) and I try to go multiple lines, this is what happens:
Code:
[root@SectionI13] > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa After the first pass...
Code:
aaaaaaaectionI13] > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa And after the second pass...
Now, I'd be fine and dandy with this, if it wasn't so hard to figure out what I was typing after the first pass, because it's just plain hard to understand a command when there's the second half of it in front of the first half of it.
Is there a way to make fedora 11 can write the hfs+ partition? Beside fedora i have mac os x, and usually i use third partition(fat) as medium to transfer file from fedora to mac.
I've installed Ubuntu 10.04 and is seems great! now I would like to know what do I have to do in order to enable it to write Hebrew? is there any guide that explains how to install other languages as well?
I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.
i want to make pen drive as write protected for ubuntu and windows.....how to do that??? and if i want to write on it then how to make remove write protection..