Run the command at startup (commands with permanent Mac and root permissions)

Source: Internet
Author: User

1. Start the program and execute commands

Write the command or Startup Program command to/etc/rc. Local.

Note: Only "commands that can be executed by logged-on users are allowed" can be executed in the file"

If Mac is permanently modified, write the following statement into/etc/rc. Local.

Ifconfig eth0 down

Ifconfig eth0 HW ether **:**:**:**:**:**

Ifconfig eth0 up

2,Start the script

(1) run the script in/etc/rc. Local.

(2) Add the soft link of the script to the corresponding runlevel (not tested yet)

3. How can I solve the problem that a common user after logging on has the right to execute commands only after executing the root command?

Idea 1:/etc/passwd to change the default shell of this common user to bash

The test is not feasible and only solves the problem of normal user input prompt.

Train of Thought 2: compile as a module? Not tested

Idea 3: Change the UID of a common user to 0 in/etc/passwd, and grant the root permission to the common user (the security is not high !)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.