Copy all users linux

Linux Mint Forums

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

analog of Windows ALL USERS\DESKTOP folder

Post by illki » Mon May 25, 2015 10:52 am

Hi all,
is there anything like all users forlder in linux?
I would like to setup applications shortcuts on the desktop (firefox rdp libreoofice etc) for everyone who currently use pc or will use it in the future?
in windows i just needed to copy all needed shortcut files to all users\ desktop , how can i do it here?
thanks in advance fo reply

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Re: analog of Windows ALL USERS\DESKTOP folder

Post by xenopeek » Mon May 25, 2015 10:59 am

I don’t think there is a standard feature for that, at least not that I know. Copying shortcuts to existing other users can be done manually. You can create a Desktop directory in /etc/skel/ and copy the shortcuts there for these to be copied to any new user accounts you create later.

Image

Re: analog of Windows ALL USERS\DESKTOP folder

Post by richyrich » Mon May 25, 2015 1:58 pm

Each username will have their own directory under the primary /home directory. Any copying files to other username directories will need to be done by the superuser, easily done by right clicking on the /home foler in Thunar file manager, and choosing ‘open folder as root’.

Re: analog of Windows ALL USERS\DESKTOP folder

Post by DrHu » Mon May 25, 2015 2:28 pm

  • You could if you made a share make it match that name /users/public/Desktop
    —the only thing you will (not) miss is the need to know the drive letter (Linux doesn’t use drive letters)
  • Windows
    C:\
  • Linux
    /

That’s only to provide common items that may be shared, but since each user (as already posted) gets its own /home: you can’t get the windows equivalent of dumping items, such as shortcuts onto each users /home/desktop and have them load on a login..
—you need to make it happen in another way..

Re: analog of Windows ALL USERS\DESKTOP folder

Post by illki » Tue May 26, 2015 3:08 am

Doing this manually is not an option — as I have 50+ users in domain and almost everyone can use this machine
is there somekind of automated solution? maybe via script?

This is my first linux machine in the windows AD enviroment and I test how it behave and what problems occuring on the machine

Читайте также:  Команда top linux выйти

Re: analog of Windows ALL USERS\DESKTOP folder

Post by xenopeek » Tue May 26, 2015 6:13 am

You should perhaps have lead with that bit I suggest editing your first post here and adding that information.

Image

MtnDewManiac Level 6
Posts: 1491 Joined: Fri Feb 22, 2013 5:18 pm Location: United States

Re: analog of Windows ALL USERS\DESKTOP folder

Post by MtnDewManiac » Tue Jun 09, 2015 11:15 pm

Introduce your users to the beauty of a clean desktop and the functionality of the menu.

Just kidding, but. Well, it’d make your job a lot easier. You’d be doing your small part to help preventing Lazy Brain Syndrome and the dumbing down of the human race. And, well. There are some beautiful desktop backgrounds out there .

You could always give all 50+ users the same user name and password information in an email, then delete every account except the one that has the information you distributed, and then warn everyone that they’ll need to keep their private data on a USB drive because of security concerns. Problem solved, all users will see the same cluttered desktop when they log in. (Okay, now I really AM kidding. But I do find myself wondering if such a strategy has ever been used, lol.)

Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O’Donnell fat.

Re: analog of Windows ALL USERS\DESKTOP folder

Post by justwally » Fri Jun 19, 2015 10:02 pm

Because we are talking about Linux, here, no matter what you do, you will have to ‘chown‘ the files/folders for each user after you copy them to the new machine. This is a bit problematic because of the file owner/group thing.

A custom Programs/Apps Menu file might be a more workable solution.

Re: analog of Windows ALL USERS\DESKTOP folder

Post by scryan » Mon Jun 22, 2015 6:58 pm

xenopeek wrote: I don’t think there is a standard feature for that, at least not that I know. Copying shortcuts to existing other users can be done manually. You can create a Desktop directory in /etc/skel/ and copy the shortcuts there for these to be copied to any new user accounts you create later.

I think this would be the *right* answer. or at least cleanest. Its what it is there for after all. While it only works for future users, from the sound of the question this may be a new system so it could be done before we start adding users?

otherwise while I don’t know the code offhand a bash script could pretty easily copy a file or directory into each directory in /home

Or directory under desktop with a share partition mounted under it.

MtnDewManiac Level 6
Posts: 1491 Joined: Fri Feb 22, 2013 5:18 pm Location: United States

Re: analog of Windows ALL USERS\DESKTOP folder

Post by MtnDewManiac » Mon Jun 22, 2015 7:07 pm

I think it’s not a «standard feature» because it is assumed that most users on a multi-user system wish to keep their data separate (and, often, private) from the other users on that system. IIRC, one can even install applications in such a way that they are only installed for that user instead of system-wide (although I’m probably mistaken about that).

Читайте также:  Команды дефрагментации в linux

If the above wasn’t the case, all users could/would just use the same login/account, wouldn’t they? But people have different credentials, different web browser bookmarks (and different favored web browsers), different favored text editors, differing viewpoints on the desktop (keeping everything off of it except for the background image and running application windows vs. having it cluttered with files, duplicated application launch shortcuts from the menu, what-have-you), even — since the inclusion of the Whisker menu — differing opinions of which Xfce menu is the best, et cetera. Thus. Separate /home/ directories for each user.

Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O’Donnell fat.

  • Important Notices
  • ↳ Rules & Notices
  • ↳ Releases & Announcements
  • ↳ Main Edition Support
  • ↳ Beginner Questions
  • ↳ Installation & Boot
  • ↳ Software & Applications
  • ↳ Hardware Support
  • ↳ Graphics Cards & Monitors
  • ↳ Printers & Scanners
  • ↳ Storage
  • ↳ Sound
  • ↳ Networking
  • ↳ Virtual Machines
  • ↳ Desktop & Window Managers
  • ↳ Cinnamon
  • ↳ MATE
  • ↳ Xfce
  • ↳ Other topics
  • ↳ Non-technical Questions
  • ↳ Tutorials
  • Debian Edition Support
  • ↳ LMDE Forums
  • ↳ Beginner Questions
  • ↳ Installation & Boot
  • ↳ Software & Applications
  • ↳ Hardware Support
  • ↳ Networking
  • ↳ Tutorials
  • ↳ Other Topics & Open Discussion
  • ↳ LMDE Archive
  • Interests
  • ↳ Gaming
  • ↳ Scripts & Bash
  • ↳ Programming & Development
  • Customization
  • ↳ Themes, Icons & Wallpaper
  • ↳ Compiz, Conky, Docks & Widgets
  • ↳ Screenshots
  • ↳ Your Artwork
  • Chat
  • ↳ Introduce Yourself
  • ↳ Chat about Linux Mint
  • ↳ Chat about Linux
  • ↳ Open Chat
  • ↳ Suggestions & Feedback
  • International
  • ↳ Translations
  • ↳ Deutsch — German
  • ↳ Español — Spanish
  • ↳ Français — French
  • ↳ Italiano — Italian
  • ↳ Nederlands — Dutch
  • ↳ Português — Portuguese
  • ↳ Русский — Russian
  • ↳ Suomi — Finnish
  • ↳ Other Languages
  • ↳ Čeština-Slovenčina — Czech-Slovak
  • ↳ Magyar — Hungarian
  • ↳ 日本語 — Japanese
  • ↳ Polski — Polish
  • ↳ Svenska — Swedish
  • ↳ Українська — Ukrainian

Powered by phpBB® Forum Software © phpBB Limited

Источник

Copy all users’ .bash_history in one go

Is it possible to use cp to copy every user’s .bash_history file into the same folder (with the username appended)? Or is it at least possible to copy them into a parallel set of folders? I can’t seem to figure this out. I do have root access.

Just a thought from a sysadmin; what you’re suggesting is sort of like a security guard rooting through employees desks and lockers. Sure, it’s company property and if your boss tells you to, that’s one thing; but if they’re not properly informed that you intend to do so, I’d expect some backlash. If I found someone did that to me, I’d immediately quit; that’s great excuse to move on to a higher paying job.

I would not quit over it (well, not until I found a better job), but I would start looking around. and I would point them to local law (dutch) which makes that illegal unless it in the ’employee/computer rules’. If it is not in there then you are doing illegal things. (Which means that if your boss orders you to do that you print a copy of the email and keep it in a safe place. Or go to legal and talk with them). — Now that is from a professional IT’er legal view. If you are at home with a server and a few friends things kind a change.

Читайте также:  Linux samba настройка gui

3 Answers 3

tl;dr; for a in /home/* ; do cp $a/.bash_history /tmp/$a.bash_history ; done

Longer version:

for a in pattern loops over all items in a pattern.
The pattern itself is stores in the variable called a.

Examples:
for a in * ; do echo $a ; done echo’s all filenames.
for a in /home/* ; do echo $a ; done echo’s the names of all homedirs in /home.

Instead of echo we use the copy command. (cp)

And since we do not want to overwrite all files we either need to change the destination name, or we need to concatenate them all in one file.

To copy we use cp $a /tmp/$a_file (all files are now named differently.

To concattenate we can use cat with append to redirection.
for a in /home/* ; do cat $a/.bash_history >> /tmp/all-users_bash_history ; done

Источник

Copying Linux users and passwords to a new server

I am migrating over a server to new hardware. A part of the system will be rebuild. What files and directories are needed to copy so that usernames, passwords, groups, file ownership and file permissions stay in intact? Ubuntu 12.04 LTS.

3 Answers 3

/etc/passwd - user account information less the encrypted passwords /etc/shadow - contains encrypted passwords /etc/group - user group information /etc/gshadow - - group encrypted passwords 

Be sure to ensure that the permissions on the files are correct too

+1 from me. I wondered about /home as well; generally, ssh keys live in the home directories, so ~/.ssh at least can be considered part of the authentication infrastructure.

@MadHatter: In truth I kind of assumed that the OP would know that they needed to copy the user home directories but I guess you never know here on SF 🙂

An important point: this assumes a server with file-based authentication only. To migrate a server that uses e.g. LDAP or NIS these files will not be enough, especially if the authentication server is on the same system. Other subsystems (e.g. Samba, SQL) may also have their own authentication databases.

I did this with Gentoo Linux already and copied:

If the files on the other machine have different owner IDs, you might change them to the ones on /etc/group and /etc/passwd and then you have the effective permissions restored.

Be careful that you don’t delete or renumber system accounts when copying over the files mentioned in the other answers. System services don’t usually have fixed user ids, and if you’ve installed the packages in a different order to the original machine (which is very likely if it was long-lived), then they’ll end up in a different order. I tend to copy those files to somewhere like /root/saved-from-old-system and hand-edit them in order to just copy the non-system accounts. (There’s probably a tool for this, but I don’t tend to copy systems like this often enough to warrant investigating one.)

Источник

Оцените статью
Adblock
detector