Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Currently I directly type the following command to bind static ip for eth0 via normal user.
$sudo ifconfig eth0:1 192.168.20.66

How do I run this command when boot Ubuntu without typing password?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can put the command in rc.local file.

Open gedit with root access gksu gedit /etc/rc.local

Before the end line (exit 0), put your command without sudo

Like

ifconfig eth0:1 192.168.20.66
exit 0
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.