Force a user to change their password at next login
Tue 28 October 2014 by Mikhail BasovAIX:
pwdadm -f ADMCHG <username>
HP-UX, Solaris:
passwd -f <username>
RHEL 6:
passwd -e <username>
RHEL 5:
usermod -L <username> # lock user
chage -d 0 # set password expired
usermod -U <username> # unlock user
('chage' - change adge)
Check TZ 2014f patch installation
Oct 26, 2014 in the Russian Federation time zone switching to whinter time will happiened.
The following command help to check is correct time zone patch installed:
# perl -e 'print scalar(localtime(1414305000))."\n"'
If patch is installed:
Sun Oct 26 09:30:00 2014
If not:
Sun Oct 26 …
Store and run ex: commands in text file
It is possible to store any ex: commands in text file and then execute them.
For example. I want to periodically insert current content of some file in other text file.
Selectively set 'execute' permission for directories.
Task:
Recursively change permissions:
user:
rwx - for directories
rw - for files
group:
rx - for directories
r - for files
other:
rx - for directories
r - for files
Solution:
chmod -R u+rwX,go+rX,go-w /directory
Explanation:
Quote from HP-UX chmod man page about 'X' (capital X) option:
X Conditionally add or …
Copy directory tree with access rights but without files
To copy only directory structure with access rights from current directory (./) to target directory (../test1) issue the following command:
read moreForce Linux user to change password
usermod -L user # lock user
chage -d 0 # set password expired
usermod -U user # unlock user
('chage' - change adge)
read moreRedirect STDERR to STDOUT and then to file
How to redirect STDERR to STDOUT and then redirect to file?
read more