Tuesday, July 23, 2013

userdel: user is currently logged in

userdel: user `username` is currently logged in

If you are trying to remove / delete a user 
# userdel username
and it shows following warning

userdel: user `username` is currently logged in

Now you are not able to remove the user.

Solution :

Run following command.
# pgrep -u username
In place of word username, put your username which is giving you trouble.
Now kill the instances using
# killall -u username
Now try to delete your user but you are still getting same message, check again
# pgrep -u username
You can't run delete user command successfully until you get the instances of the same user using pgrep command.
The result of pgrep command should be blank, No result.




Friday, July 12, 2013

Linux : crontab permission denied

Linux : user can't create/update crontabs
Crontab permission denied for Linux user
Allow user to create crontabs on Linux

By default the permission of file /usr/bin/crontab is
 -rwxr-xr-x 1 root root 34784 Apr 11 10:58 /usr/bin/crontab
Only root can create/update/delete crons.

If you want to allow user to create crons on Linux system, follow this.

a) If you are using CentOS, Fedora or RHEL
The permissions of crontab file should be
 -rwsr-xr-x 1 root root 34784 Apr 11 10:58 /usr/bin/crontab 
Owner and Group both should be root for the file as well as SUID bit should be set.
The ‘s’ in user field in place of ‘x’ indicates that SUID bit is set. 
To set SUID, Run following command
# chmod 4755 /usr/bin/crontab
or
# chmod u+s /usr/bin/crontab

b) If you are using Debian or ubuntu
The permissions of crontab file should be 
 -rwxr-sr-x 1 root crontab 34784 Apr 11 10:58 /usr/bin/crontab 
Owner should be root but the Group should be crontab as well as SGID bit should be set.
The ‘s’ in group in place of ‘x’ indicates that SGID bit is set.  
To make Group 'crontab', run following command.
# chgrp crontab /usr/bin/crontab
To set SGID, Run following command
# chmod 2755 /usr/bin/crontab
or
# chmod g+s /usr/bin/crontab

Filezilla - Response:530 Sorry, the maximum number of clients (n) from your host are already connected

Filezilla - Response:530 Sorry, the maximum number of clients (n) from your host are already connected

Solution 1
Open filezilla.
File -> site manager -> select your 'My Sites' entry -> transfer settings -> uncheck the check box "Limit number of simultaneous connections"

Try again.

Solution 2 -
Close all connections of same site. Do not open multiple filezilla instances for same site.

Restart filezilla.