Suspended Jobs vs Running jobs in Linux

Background Job : A job which is running background in the same shell. You can use bg command to see any background jobs.
Foreground job : A Job which is running in the same shell right before your eyes.
Suspended Job : Its a stopped/pause job but you can resume their running.
Let me explain with example very clealy
virt00# sleep 180
^Z
zsh: suspended  sleep 180
virt00# jobs
[1]  + suspended  sleep 180
virt00# bg
[1]  + continued  sleep 180
virt00# fg
[1]  + running    sleep 180
^Z
zsh: suspended  sleep 180
virt00# jobs
[1]  + suspended  sleep 180
virt00#
I have started a Job named sleep 180 then I stopped with CTRL+Z . right now my job is in suspended mode.
I see it by typing jobs command. Now I want to resume its running in background so I typed bgcommand then it will move from suspended state to running state but in background it will run.
now I typed command fg to bring it foreground , now job wont get stepped but it will pull from background jobs queue and push into foreground jobs queue.
So yes background jobs and foreground jobs always are in running state.

Deny SSH access to particular users

We all know SSH is very famous and the best service for remote access.

Today I am going to tell you how to block or allow only particular users or group from SSH access.

open sshd_config file as per your environment

in Debian

vim /etc/ssh/sshd_config


Then add below line to enable access for only below users

AllowUsers username1 username2


to deny access for only below users add a line as

DenyUsers username1 username2


as in the same way

AllowGroups group1 group2


and to deny groups

DenyGroups group1 group2


 But there is something very important you have to follow here. It is the order of mentioning.

From manpage of SSH 

The allow/deny directives are processed in the following
      order: DenyUsers, AllowUsers, DenyGroups, and finally
      AllowGroups.

So first mention DenyUsers and then AllowUsers then only it will works and same for DenyGroups and AllowGroups

Hope it helps.



How to see IOWAIT in Linux

Hello ,

You can use sar command.

in Ubuntu you can install it with

sudo apt-get install systat


and enable data collecting

sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat


start service with

 
/etc/init.d/sysstat start


To see I/O latency type command as

sar 1 1


that means it will give two responses with 1 sec as interval.

Example :

root@virt01:~# sar 1 3
Linux 3.19.0-42-generic (virt01.ubuntu.com)     13/02/16        _x86_64_        (1 CPU)

12:26:23        CPU     %user     %nice   %system   %iowait    %steal     %idle 12:26:24        all      0.00      0.00      0.00      0.00      0.00    100.00 12:26:25        all      0.00      0.00      0.99      0.00      0.00     99.01 12:26:26        all      2.02      0.00      0.00      0.00      0.00     97.98 Average:        all      0.67      0.00      0.33      0.00      0.00     99.00 root@virt01:~#

Hope that helps.