When I type: $ sudo echo 1 > /proc/sys/net/ipv3/ip_forward
I get: bash: /proc/sys/net/ipv3/ip_forward: No such file or directory
I can't mkdir any folder past /proc/sys/net nor can I move or create a file there.
I try to setup my box to IP forward before launching arpspoof
Thank's for your input!
EDIT:
Now with a variant I get:
$ sudo echo 1 > /proc/sys/net/ipv4/ip_forward
bash: /proc/sys/net/ipv4/ip_forward: Permission denied
1- Where your example says ipv3, it should probably read ipv4.
2- Here's one other way to accomplish this without using sudo -s:
Now, the explanation for this problem is as follows. The original command has this structure:
Part 1 runs as sudo, BUT you're then trying to redirect output to a file. The redirection itself "runs" as an unprivileged user, that's why it has no permission to write to the file.
The solution I propose does the "echo" as an unprivileged user, but then pipes that to the "tee" command, which we run through sudo. Thus, tee will be run as root and will be able to write to the file.
Tee basically takes standard input and writes it to both a file and stdout. This is commonly used to write to a file while also getting the output on-screen. If you want to know more about tee, check the man page.