I need to write a bash-script that will create a new user named user1 and an empty file my_txt.txt in ~user1/tmp/ . The problem is terminal asks the password for new user and i don't know how to input it along su - user1
Asked
Active
Viewed 346 times
suto the new user in order to be able to create files for them. – telcoM Apr 14 '22 at 13:52su? does the question itself require it? Also, to create a new user, you're either already running as root or you usedsudoor similar. – cas Apr 14 '22 at 13:52chownandchgrpmight be useful. – Bodo Apr 14 '22 at 13:58