Tag Info

Hot answers tagged

5

You can add the files you want to /etc/skel directory. $ sudo touch /etc/skel/test.txt $ sudo useradd -m test $ ls /home/test test.txt From man useradd: -k, --skel SKEL_DIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by ...


5

sudo usermod -c "Jecht Tyre" jecht You can change it with -c option. -c is for adding comment usermod -c "YOUR NAME" username


2

Just backup the /etc/shadow file, and change the users passwords with passwd: Backup the shadow file: sudo cp /etc/shadow /etc/shadow.bak Change the password of the user you want to access (e.g. testuser): sudo passwd testuser When done, restore the /etc/shadow file from the backup: sudo mv /etc/shadow.bak /etc/shadow Note that all passwords should ...


1

the ownership is preserved, but probably you dont have the same users in both enviroments. check the user id of by example user www-data in both servers and compare it. you may see another name, but the id will be the same


1

rsync can't preserve ownership if it's being run by a non-root user on the destination system, because only the superuser is allowed to create files that are owned by someone else. Instead of using rsync create a tar file on the intermediate system. Then when you restore it on the ultimate target system, you can do so as root in order to give the original ...


1

There are a couple of ways, usermod is a good tool that comes to mind (I have trouble with it at times). Another is chfn this will generally give you a lot of options to change (phone number, office location, and other stuff). # chfn username should open your favorite editor for you to change things with. There are some unsafe methods, but I don't ...


1

The reason for EPERM (the permission denied error ) is here: drwxr-xr-x 5 www-data www-data 4096 juil. 30 13:47 . The directory where you are trying to create a file (in other words change contents of the directory-file) is writeable only for user www-data, which you are not. Either mark the directory as writeable for the group, change the user to ...


1

You can use awk to filter out new users from /var/log/secure as follows:- awk '/new\ user/ {gsub(/,|name=/,"",$8); print $1, $2, $3, $8}' /var/log/secure Note: Debian systems (I believe) use /var/log/auth.log instead.


1

The passwords are stored in the shadow file, not in /etc/passwd, so you need to delete the contents of the second column from /etc/shadow. An entry should look something like this: root::16229:0:99999:7:::


1

So as you said yourself @krzysto, the solution is to add the following to the sudoers file beans ALL = (root,apache) NOPASSWD: /usr/bin/ksh -c /opt/renovations/var/script-*.sh beans ALL = (root,apache) NOPASSWD: /usr/bin/bash -c /opt/renovations/var/script-*.sh The next piece that is missing is to make sure that the group has execute permissions on the ...



Only top voted, non community-wiki answers of a minimum length are eligible