0

In Linux on my Virtual Box, How do I set default values for any future new user? Also, how do I create an empty file named TESTFILE and have it copied to each new users home directory.

I believe I did the second question correctly. Are the steps below correct for question 2?

root# touch testfile.txt
root# cp -a ~/testfile.txt /etc/skel/

Then to ensure it worked I created a new user and listed files in that directory:

root# useradd -c "NewUser" -md /home/NU -e MONTH/DATE/YEAR -s /bin/bash -u 2000 newuser
root# su - newuser
newuser~ ls -l

OUTPUT --> total 0
-rw-r--r-r-- newuser DATE testfile.txt

THANK YOU FOR ALL HELP! I AM NEW AT LINUX.

2
  • Obviously the file you put into /etc/skel is not called FAKE. What default values are you thinking of? Commented Dec 10, 2022 at 23:09
  • You don't need to create the file in root's home dir and then copy it to /etc/skel (although that obviously works). You can create it in /etc/skel, with no need to copy it: touch /etc/skel/testfile.txt (as root, of course, because only root has permission to write in /etc/skel). Commented Dec 11, 2022 at 2:25

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.