Posts

Showing posts from December, 2013

Command-Password Less scp, ssh and rsync

Image
Whenever you need to use  scp  to copy files, it asks for passwords. Same with  rsync  as it(by default) uses  ssh  as well. Usually  scp  and  rsync  commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an  expect  script to provide the password. Of course, I didn't. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it... Lets say you want to copy between two hosts  host_src  and  host_dest .  host_src   is the host where you would run the  scp ,   ssh   or   rsyn  command,  irrespective of the direction of the file copy ! 1.     On  host_src , run this command as the user that runs  scp / ssh / rsync $ ssh-keygen -t rsa This will prompt for a passphrase. Just press the enter key. It'll then generate an identification (privat

Command-TOP By process name

1-Grep the process name and store the pid in variable. 2-use the "top -p" with "pid variable"  to see the CPU usages. 3-For Single process top command. top -p   $(pgrep -d',' sccAs) 4-Below is the example of multiple process using grep and top. ss7=$(pgrep -d',' ss7) tasMgr=$(pgrep -d',' tasMgr) diamMgr=$(pgrep -d',' diamMgr) profileMgr=$(pgrep -d',' profileMgr) sipMgr=$(pgrep -d',' sipMgr) sccAs=$(pgrep -d',' sccAs) ccSvc=$(pgrep -d',' ccSvc) xcapSrv=$(pgrep -d',' xcapSrv) utimacoLiClient=$(pgrep -d',' utimacoLiClient) rmtAppAgent=$(pgrep -d',' rmtAppAgent) top -p $ss7 -p $tasMgr -p  $diamMgr -p $profileMgr -p $sipMgr -p $sccAs -p $ccSvc -p $xcapSrv -p $utimacoLiClient -p $rmtAppAgent

Command-Allow or Restrict Incoming VNC Connections

Iptables Open VNC Port To Allow Incoming VNC Connections http://www.cyberciti.biz/faq/linux-iptables-open-vncserver-port-6000-5800-5900/ ------------------------------------------------------------------------------------- in CENTOS, DEBIAN / UBUNTU, IPTABLES How do I configure Linux system firewall to allow incoming VNC connections? VNC server listens on the following TCP ports: => VNC server on display 0 will listen on TCP ports 5800, 5900 and 6000 => VNC server on display 1 will listen on TCP ports 5801, 5901 and 6001 => VNC server on display N will listen on TCP ports 580N, 590N and 600N In other words a VNC server listens for a VNC client on TCP ports 5800+N, 5900+N, and 6000+N where N is the display which starts at zero. So, Allow or Restrict Incoming VNC Connections 5800+N - Java-based vncviewer; 5900+N - VNC Client Port; 6000+N - X Server port. Find Out VNC Port Type the following command: # netstat -tulp | grep vnc Update /etc/sysconfig/ipt