Pages

Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Monday, January 31, 2011

Using rsync to synchronise different machines over ssh

#!/bin/bash
# January 2011 : rsync to various machines.
# author : rileyrg@gmail.com
# The LOCALHOST machine should have itself in the
# /etc/hosts files as something lile 1.1.1 so that
# the ping fails : basically a check to see if the
# destination host is available.
for myhost in asus dev x30 t60
do
ping -c 1 "$myhost" > /dev/null
if [ "$?" -eq 0 ] ; then
echo "$myhost up"
rsync -avz --delete ~/common-files $myhost:
else
echo "$myhost down"
fi
done




--
My Emacs Files At GitHub

Monday, September 27, 2010

Keep something called shush quiet


Resyncing my little network including the Pub machine, I realised that my ssh logins were too noisy. eg. I would




>ssh $PUB




to see the following unnecessary chatter




Linux thinkpadt60 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Mon Sep 27 19:16:11 2010 from development




The solution is very simple. On the remote machine simply create a .hushlogin file.




>touch ~/.hushlogin




If it doesnt work then check your /etc/login.defs file for the hush settings. Mine are like this:




# If defined, file which inhibits all the usual chatter during the login
# sequence. If a full pathname, then hushed mode will be enabled if the
# user's name or shell are found in the file. If not a full pathname, then
# hushed mode will be enabled if the file exists in the user's home directory.
#
HUSHLOGIN_FILE .hushlogin
#HUSHLOGIN_FILE /etc/hushlogins




--
My Emacs Files At GitHub