logo
down
shadow

Protecting /etc/passwd and /etc/shadow from concurrent access


Protecting /etc/passwd and /etc/shadow from concurrent access

By : Paul Parker
Date : October 22 2020, 11:12 PM
seems to work fine I think most applications use PAM these days, don't they? http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_ADG.html. That said, you might look at the source for `pam_unix.so' to see how they do it. I looked in pam_unix_passwd.c and followed this:
code :


Share : facebook icon twitter icon
Does the Android operating system have files like /etc/passwd, /etc/shadow, and /etc/group?

Does the Android operating system have files like /etc/passwd, /etc/shadow, and /etc/group?


By : user2784114
Date : March 29 2020, 07:55 AM
To fix the issue you can do This thread discusses how that is done: http://groups.google.com/group/android-ndk/browse_thread/thread/adddb27c1a5438e9
It contains a broken link to a git repository though, you can find a list of name and IDs in https://android.googlesource.com/platform/system/core.git/+/master/include/private/android_filesystem_config.h.
Use of /etc/passwd-, /etc/shadow-, /etc/group-

Use of /etc/passwd-, /etc/shadow-, /etc/group-


By : user3681432
Date : March 29 2020, 07:55 AM
To fix this issue These are backups of previous versions.
Manual pages show these files and states:
Edited shadow and passwd to clear root password but new password doesn't work

Edited shadow and passwd to clear root password but new password doesn't work


By : abdul18
Date : March 29 2020, 07:55 AM
Any of those help It is possible that "/etc" is mounted on a ramdisk (or as tmpfs), which allows you to change the password at runtime but the changes are not propagated to the actual passwd and shadow files. The "/etc" is remounted on bootup from a flash device causing the old settings to be used.
After logging in to the system execute mount and check where "/" or "/etc" is mounted, then check the type. A value of tmpfs will prove the statements above. Also check if "/etc" is a link to a folder in "/var". "/var" is usually on tmpfs.
Can not add new user in docker container with mounted /etc/passwd and /etc/shadow

Can not add new user in docker container with mounted /etc/passwd and /etc/shadow


By : Shaller Yu
Date : March 29 2020, 07:55 AM
it helps some times It's failing because passwd manipulates a temporary file, and then attempts to rename it to /etc/shadow. This fails because /etc/shadow is a mountpoint -- which cannot be replaced -- which results in this error (captured using strace):
code :
102   rename("/etc/nshadow", "/etc/shadow") = -1 EBUSY (Device or resource busy)
# cd /etc
# touch foo
# mv foo shadow
mv: cannot move 'foo' to 'shadow': Device or resource busy
$ docker run -it --rm -v $PWD/my_etc:/my_etc centos
[root@afbc739f588c /]# ln -sf /my_etc/my_passwd /etc/passwd
[root@afbc739f588c /]# ln -sf /my_etc/my_shadow /etc/shadow
[root@afbc739f588c /]# ls -l /etc/{shadow,passwd}
lrwxrwxrwx. 1 root root 17 Oct  8 17:48 /etc/passwd -> /my_etc/my_passwd
lrwxrwxrwx. 1 root root 17 Oct  8 17:48 /etc/shadow -> /my_etc/my_shadow
[root@afbc739f588c /]# passwd root
Changing password for user root.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@afbc739f588c /]# 
How can I pull a line out of /etc/passwd if its corresponding shadow entry is 999999?

How can I pull a line out of /etc/passwd if its corresponding shadow entry is 999999?


By : tals
Date : October 24 2020, 11:12 AM
help you fix your problem I want to compare each user in the passwd file with his entry in the shadow file, and print out the whole line of the passwd file if the entry in the shadow file matches 999999. What is the easiest way in Perl to do this? Or I suppose I could awk the values out of one file and match in the other file? What is the best way of doing this?
Related Posts Related Posts :
  • How to use priority_queue with a non-static compare method of class instance?
  • Template parameters inside and outside class/struct
  • Determining prime number
  • How to resolve ambiguity between constructors taking std::string and std::vector
  • My program crashes when I try to change private values from an object
  • Unordered_map with custom class as key
  • Strict aliasing rules broken with templates and inheritance
  • C++ Derived Class Override Return Type
  • singly linked list c++ constructor, destructor and printing out
  • How to clone class with vector of unique_ptr to base class
  • error: no match for operator
  • std::vector doesnt accept my struct as template
  • selection of people's contours
  • how to fix the (Error using mexOpenCV) on matlab?
  • Is or was there a proposal for c++ to use the context for short enum values?
  • Fair assumptions about std::hash implementations
  • undefined reference to libusb using cyusb
  • Function returns null pointer instead of address
  • C++17 copy elision and object destruction
  • Input multiple strings via operator>> c++
  • Avoiding overflow boost container
  • How to Write a Lambda Wrapping a Function with Optional Return Value
  • Partial specialization with more template parameters
  • How to convert fixed size array to pointer on pointer array
  • Memory leak in const member constructor with tag dispatching
  • C++ function with a generic and optional class
  • Custom QGraphicsItem That Contains Child QGraphicsItems
  • Are There Restrictions on What can be Passed to auto Template Parameters?
  • Rotating line inside rectangle bounds
  • Why do I need dynamic memory allocation if I can just create an array?
  • How can I convert a text file into a form that MPI_Bcast can send?
  • How to get array of all `this` of an instance
  • Using pointers as parameters
  • Automatic type deduction with const_cast is not working
  • Why does std::is_rvalue_reference not do what it is advertised to do?
  • Function Template Specialization with Forward Declared Type
  • template deduction failed in vector
  • Is there a signed `sizeof` alternative in Qt
  • clarification on overloading the -> operator
  • What is __m128d?
  • QtConcurrent: why releaseThread and reserveThread cause deadlock?
  • Function receiving different value than passed
  • Can C++ close a '''fstream''' variable after '''.close()'''?
  • Is it necessary to overload operator in this specific case
  • Comparing an element of a string array with a string
  • how to dereference a pointer of a map of pointers to objects in c++
  • How recursive function control flow change for static variable?
  • SDL 2 blitting BMP File
  • Why does an extremely large value cause this code to repeat infinitely?
  • Function returning different value than what is in function body before return statement
  • Struggling with including Headers in another header file (C++)
  • WebViewProcessControl initialization crash
  • C++ exception 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x00C02F30)
  • What's difference between forward and move in the constructor of class?
  • C++: Is it possible to condense `bool` objects within the same byte?
  • I cant understand this access modifier
  • Boost Spirit X3: Collapsing one-element lists
  • How can I add a char to an istringstream?
  • Wrapping variadic templates in pybind11
  • C++ referencing instances created within a function's scope
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org