Browsing articles tagged with "linux - 3/779 - Admins Goodies"
Apr 22, 2013
tom

How do I log every command executed by a user?

I want to monitor all user’s activity in my server. Even when the user executes a shell command from some editor like vim I want to see them in the log file. I have checked the tool acct but it is not listing the complete commands. (Please correct me if I have missed some options which does already). Which Linux tool I should be looking at to solve this problem? Asked by Supratik Add this […]

Continue Reading »
Apr 9, 2013
tom

Is it possible to never shutdown linux?

Assuming hardware failure is not a factor, and the requirement of being able to update periodically, is it possible to never shutdown Linux? I typically do a full reboot after updates, especially kernel updates, but is there a way to keep my machine on and still do these? People always hear about incredible up-time, but how is that really possible if you must reboot after major updates. Maybe a different run level? But then how […]

Continue Reading »
Mar 22, 2013
tom

What does “- – -” in ‘echo “- – -” > /sys/class/scsi_host/host0/scan’ mean?

I know the linux command echo “- – -” > /sys/class/scsi_host/host0/scan is used to rescan scsi host. But what does “- – -” mean in the command? Asked by Harold Chan The three values stand for channel, SCSI target ID, and LUN. The dashes act as wildcards meaning “rescan everything” A quick google search turns up this RHEL doc (and dozens of other answers) This is the same command described in Section 7, “Adding a […]

Continue Reading »
Mar 22, 2013
tom

cannot use any yum command: no space left on device

if i use any yum command, i get Loaded plugins: fastestmirror Traceback (most recent call last): File “/usr/bin/yum”, line 29, in <module> yummain.user_main(sys.argv[1:], exit_code=True) File “/usr/share/yum-cli/yummain.py”, line 285, in user_main errcode = main(args) File “/usr/share/yum-cli/yummain.py”, line 114, in main base.doLock() File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 1791, in doLock while not self._lock(lockfile, mypid, 0644): File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 1861, in _lock os.write(fd, contents) OSError: [Errno 28] No space left on device If i use the top command i see […]

Continue Reading »
Mar 16, 2013
tom

How to synchronize command calls on Linux

This is my specific problem I need to solve (But my question is different, so please read on even if you don’t know what fail2ban is): I’m trying to use fail2ban on a linux server to ban brute force attacks on multiple services (ssh, dovecot, apache, postfix, …). Now I stumbled over the problem that fail2ban seems to execute multiple iptables commands at the same time (with threads in Python) and this fails pretty often […]

Continue Reading »
Feb 18, 2013
tom

hostnames: meaningful vs meaningless

Assume puppet-managed cluster of different servers – hardware, software, operating systems, virtual/dedicated etc. Would you go for meaningful hostnames (mysqlmaster01..99, mysqlslave001..999, vpnprimary, vpnbackup, etc). Or would you prefer meaningless names like characters from some book or movie w/e? My problem with meaningfull servers is that names usually represent a single service and if server has more than 1 purpose – it gets really messy(especially when server roles change often). Isn’t mapping service name <-> ip […]

Continue Reading »
Feb 16, 2013
tom

find command from PID

Is it possible to find the command line of a running process with its pid? the output of /proc/pid/cmdline seems that it removes the space character to it is hard to read the output. Asked by mahmood From: http://stackoverflow.com/questions/993452/splitting-proc-cmdline-arguments-with-spaces cat /proc/PID/cmdline | tr ’00’ ‘ ‘ cat /proc/PID/cmdline | xargs -0 echo Answered by Jay Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with […]

Continue Reading »
Feb 15, 2013
tom

Allow complex sudo command on Debian Linux

I need to allow a specific command on a Debian Linux box for a single user. I’ve tried this in the /etc/sudoers file: # User privilege specification zabbix ALL=NOPASSWD: /usr/bin/apt-get –print-uris -qq -y upgrade 2>/dev/null |awk ‘{print $2}’ | wc | awk ‘{print $1}’ This does not work as expected. If I run the command as user zabbix with sudo, it asks for the password (although I have specified the NOPASSWD option). However, this works: […]

Continue Reading »
Feb 14, 2013
tom

Linux: Allow complex sudo command

I need to allow a specific command on a Debian Linux box for a single user. I’ve tried this in the /etc/sudoers file: # User privilege specification zabbix ALL=NOPASSWD: /usr/bin/apt-get –print-uris -qq -y upgrade 2>/dev/null |awk ‘{print $2}’ | wc | awk ‘{print $1}’ This does not work as expected. If I run the command as user zabbix with sudo, it asks for the password (although I have specified the NOPASSWD option. However, this works: […]

Continue Reading »
Feb 8, 2013
tom

Save file after forgetting to open as root / sudo vi [duplicate]

Possible Duplicate: vim re-edit as root I could have sworn I saw this question asked. But after looking though every search result for “vi” I’m stumped/lazy. I’ve opened a file, made an edit and now I realize it’s read only and I’ve opened it as non-root me. Asked by MathewC I think you want something like this: :w !sudo tee “%” I first saw it on commandlinefu. The quotes are only necessary if the file […]

Continue Reading »
Pages:«1234567...779»