Tag Info

New answers tagged

0

I was looking for something like this (bash): hash=$(sudo cat /etc/shadow |grep "^$USER:" |cut -d: -f2) cmphash=$(mkpasswd -m sha-512 -S "$(echo "$hash" | cut -d '$' -f3)") cmp <(echo "$hash") <(echo "$cmphash") && echo "Correct password!" This works but harcodes the hash method which somehow identified by the number in echo "$hash" | cut ...


2

Most modern Unix systems use PAM to handle authentication. The pam_unix module is the one that does password authentication against /etc/password and /etc/shadow. However, you shouldn't reinvent the wheel. Asking for the user's password and running as root is a basic configuration of sudo, the de facto standard way to elevate privileges. Note that properly ...


3

Just call useradd and pass it the arguments you want. To create a system user, passs the -r option. If you don't want a home directory, pick something like /none and pass the -M option. If you want to be able to use su to run commands as that user, the user needs to have a valid shell. useradd -r -d /none -M -U -s /bin/sh I don't recommend modifying the ...


0

Simply adding an entry to /etc/passwd seems to do the job and work. I guess useradd is more robust as it does a couple of additional things without doing needless stuff like setting up a user directory. (It's a little weird though, that for such a small thing it needs to take 200ms and open and close /etc/passwd about 900 times as it strace shows.)


0

Simply create the user as usual, don't give it any password. Rm -rf the /home/thatuser directory, and edit /etc/passwd to set the shell for that user to /bin/false. You could model the /etc/passwd entry after other system users you may see in there. Just make sure you understand the /etc/passwd entry and google it if you need to. Of course also make sure ...


0

You have to remove the user from the group plugdev


2

About your actual question, see taliezin's answer (and accept that one ;) About your other problem: Search for the string 8sh9JBUR0VYeQ on the disk to figure out the disk block(s) it resides in. Then dd that disk block(s) into a file, replace that string with a known password hash (the old crypt() one - same length) and write the disk block(s) back to the ...


13

The accounts with passwords are the accounts with a glob of base64 gibberish in the second field: root:8sh9JBUR0VYeQ:0:0:Super-User,,,,,,,:/:/bin/ksh lp:VvHUV8idZH1uM:9:9:Print Spooler Owner:/var/spool/lp:/bin/sh This computer appears to be using the traditional, DES-based crypt(3) password hash. This hash is quite weak by modern standards; if you can't ...


0

The permission udiskctl using is based on a polkit policy, look here for an example: https://wiki.archlinux.org/index.php/Udisks#Configuration Check what you current polkit policy states (in the arch example it grants the permission to the storage group). Either remove the user from the appropriate groups or modify the policy.


19

You have to check man passwd: If the encrypted password is set to an asterisk (*), the user will be unable to login using login(1), but may still login using rlogin(1), run existing processes and initiate new ones through rsh(1), cron(8), at(1), or mail filters, etc. Trying to lock an account by simply changing the ...


8

This means that it is disabled for direct login. It is a user that is used for running services or to be used for rlogin. Check https://en.wikipedia.org/wiki/Passwd#Password_file


-2

Just check this link it's working perfect for me This link describes how to create a chroot user to put them in jail Importantly describes how to login as user using su command http://wp.me/p6fueV-l


0

What you want is in this answer and this answer The only thing I'll add is the -u user option for ps eg: ps -u <username> to search processes started by a user.


0

usermod -G "" username This command works in RHEL as well to remove all secondary groups of a user leaving only his primary group.


3

Reset the user by moving everything in /home/faultyuser to a backup directory like this: mkdir /home/faultyuser/BACKUP mv /home/faultyuser/* /home/faultyuser/BACKUP mv /home/faultyuser/.* /home/faultyuser/BACKUP cp -v /etc/skel/.[a-z]* /home/faultyuser/ chown faultyuser:faultyuser /home/faultyuser/.* and try to login. When this works, move all you need ...


1

A quick search turned up Two Factor SSH Setup which is a simple walkthrough of the steps required for setup.


3

Reading between the lines, what you want to configure is two-factor authentication. This will require an additional "piece of information" in addition to the password for the user to log in. There are a multitude of ways of implementing it, but a few popular options are: The open source Google Authenticator. Using a third party product like YubiKey - see ...


0

if you mean /usr/local/WebFiles/Html by the publication folder in that case I'd say yes and the answer of the question two : Create a group where you add tomcat and apache and grant this new group to read and execute the publication folder.


0

useradd only copies the content of /etc/skel when you set the -m option to create the home directory and use the -k option. You have to do that manually now with cp /etc/skel/.[a-z]* /home/testinguser/. Don't forget to set correct owner of the files: chown -R testinguser:testinguser /home/testinguser In Debian based systems adduser is easier to use, as it ...



Top 50 recent answers are included