Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to create a seperate user account in all the systems. And i have to paste few files in their desktop. I have created a seperate useraccount with 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 etc. I know after logging in to that account physically the system creates folder for new users automatically. But is there any other way to acheive this task? Coz i need to create user account for more than 200 systems.

Update:

  • Clear solution will get bounty.

Update 1:

  • Accessing the system via SSH.
  • Yes the user account must have a password.
share|improve this question
    
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

2 Answers 2

up vote 1 down vote accepted
+250

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?
share|improve this answer
    
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. –  izx 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.

share|improve this answer
    
ubuntu 10.10........... –  karthick87 Jul 30 '12 at 6:31
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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