I got a few noob questions...
I am running Slackware 12.0
1. Why is it that I cannot change permissions on /proc/sys/net/ipv4/ip_forward as root? I ran ls -l ip_forward and root is the owner. So I want to be able to give other groups permission to write to the file. So as root, I run chmod o+w ip_forward but I get chmod: changing permissions of `ip_forward': Operation not permitted Why is this so? I mean, I'm running it as root. Do I need to run it with kernel privileges? If so, how do I do that? 2. I want to make 120 files like file1, file2, file3, file4, etc What command would I use? I guess I'd need some sort of bash script. while i!=120; export i=1; touch file[i]; i++; How would I script that? Or what command would I use? |
I solved question 2.
#!/bin/bash i=0 while [ $i -lt 21 ]; do touch file$i let i=i+1 done easy as pie, Linux Rulez!! Any of you guys know the answer to question 1? |
Why did you want to write to /proc/sys/net/ipv4/ip_forward?
|
so i can turn my nic into a router, so why can't i change the permissions as root?
|
So you want echo 1 > /proc/sys/net/ipv4/ip_forward
What guide are you using? |
I want to understand why even if the file ip_forward has root as its owner, why I can't change permissions as root giving o+x to others, or maybe even adding a suid flag to it, which also returns the same error.
I'm experimenting with some pentesting tools. I want the nic to simply forward the packets, but I want to be able to write to ip_forward as a normal user. |
This should help;
http://www.google.com/search?hl=en&q...q=%2Fproc+file |
Thank you, sudo -i fixed the problem.
|
Back to problem 2,
Code:
touch file{1..120} Code:
touch file`seq -ws " file" 120` 1) man bash, search (case sensitive) for "Brace Expansion" 2) man seq |
All times are GMT -5. The time now is 06:51 AM. |