[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to run automatically a script as soon root login



Le 13/05/2024 à 13:48, Mario Marietto a écrit :
--> If they only want this thing to happen when root logs in directly on a console or ssh, then .profile may indeed be the correct answer.

Yes,I don't need to run xorg and a desktop environment,since warp-cli disconnect and warp-cli connect do not require them. I wouldn't to login as root automatically,but I've realized that this command :

echo 1 > /proc/sys/net/ipv4/ip_forward

work only if I'm root. It does not work using sudo. So,in the end I've chosen to be root instead of a normal user that can use sudo.



For this it is sufficient to  use /etc/sysctl.conf

You find in the file shipped by debian


# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

So you just have to uncomment and it will be done at boot time.


(You have the ipv6 equivalent in the same file, if needed)


--
Erwan David


Reply to: