E
E
exhang2015-01-21 22:57:12
linux
exhang, 2015-01-21 22:57:12

How to change root password on debian boot?

There is a task to change the root password when loading debian, I prescribe in rc.local:

echo -e "qwerty\nqwerty\n" | /usr/bin/passwd root

But the change does not occur, the output is empty.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
3vi1_0n3, 2015-01-21
@exhang

Because of the first line in /etc/rc.local:
#!/bin/sh -e
echo -e just doesn't work. You can try replacing the sha-bang with
#!/bin/bash

A
algebris, 2015-01-21
@algebris

echo -e "oldpassword\nnewpassword\nnewpassword\n" | passwd 1>/tmp/log.txt 2>&1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question