Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 859  / 3 Years ago, tue, june 1, 2021, 2:30:39

I need to create a separate user account in all the systems. And I have to paste a few files in their desktop. I have created a separate user account with a password remotely. However, when I type ls /home/username only examples.desktop file is shown there. There is no Desktop, Music, Videos, Documents Folder etc. I know after logging in to that account physically the system creates a folder for new users automatically. But is there any other way to achieve this? I need to create a user account for more than 200 systems.


Update:



  • The clear solution will get a bounty.


Update 1:



  • Accessing the system via SSH.

  • Yes, the user account must have a password.


More From » users

 Answers
4

Consider this an answer-in-progress, since more details are necessary on how you are adding users, whether it's the same username, etc.






Assuming you are creating a user with the same name and the same Desktop contents on each of the 200 systems, you need to do the following:




  1. Pack the custom "Desktop" contents into a tarball, and upload it somewhere. Example:




    • Suppose the Desktop folder and other custom home contents are in /home/karthick/custom-folders

    • Archive with cd ~/custom-folders && tar -cvzf ../customfiles.tar.gz .

    • Upload customfiles.tar.gz to e.g. some HTTP server, say http://personal.karthick.com/


  2. Here's the outline of the script to run on the target system to create the user with the custom folder:




    sudo useradd --create-home customuser
    cd /home/customuser
    wget -O- http://personal.karthick.com/customfiles.tar.gz | tar -xz
    sudo chown -R customuser:customuser *






More information that would be helpful to improve the answer:




  • Are you setting a password for this user? Will it be the same user?

  • How are you accessing the remote systems - SSH?


[#36508] Thursday, June 3, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fulild

Total Points: 239
Total Questions: 103
Total Answers: 112

Location: Papua New Guinea
Member since Thu, Jul 9, 2020
4 Years ago
;