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.


  • The clear solution will get a bounty.

Update 1:

  • Accessing the system via SSH.
  • Yes, the user account must have a password.
  • If there is no solution for this, I suggest you let the ubuntu-devs know, that there is a need for this function in the terminal (launchpad). I don't think you're the only one that needs this. – David Halter Aug 4 '12 at 7:45
  • You access the systems with passwordless ssh? – Salem Aug 7 '12 at 13:51
  • Yes i access all the systems with passwordless ssh.. – karthick87 Aug 7 '12 at 18:14

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?
  • Please add the information requirement as comment in the question. It would make it easier to spot and get a speedy answer. – saji89 Aug 4 '12 at 4:37
  • Please see the updated information in my question.. – karthick87 Aug 5 '12 at 14:00
  • I will try your method and if i face any problems i will let you know. As my bounty expires in short period i am aloting it to you :) – karthick87 Aug 7 '12 at 18:15
  • @karthick87: Thanks; sorry that I missed your updated comment yesterday. If you face any issues, I think we could resolve it much faster via an AU chatroom :) . In any case, please do let me know. – ish Aug 8 '12 at 0:29

Which version of Ubuntu are you using? In any case, upon creation of a user account, the contents of /etc/skel/ are copied to the user's new directory. I the usual user folders are not in /etc/skel they will not be in the new user directories either.

In that case, you might want to write a script that creates the user you need and then the folders inside their directory. It seems easier to me, rather than editing the contents of /etc/skel in 200 systems.

  • 1
    Well, if there is no smarted method, and if your /etc/skel doesn't contain those directories, I guess you have to go with a scripted method. – Marios Zindilis Jul 30 '12 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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