[Devops] Fave command line tools?
chris h
ch at zeha.at
Mon Mar 7 00:48:01 CET 2011
Hi folks,
On Sun, Mar 6, 2011 at 10:41 PM, <devops.wsm at c33s.net> wrote:
> tee - is used to split the output of a program so that it can be seen on
> the display and also be saved in a file.
Now that tee has been brought up, I'm reminded of the
you-cannot-log-in-as-root problem.
In situations where you cannot (ssh) login as root, I sometimes use
tee to append/overwrite a remote file:
echo foo | ssh $host sudo tee -a /etc/whatever.conf
Rsync has --rsync-path, which allows you to throw sudo into the mix:
user at host1% sudo rsync -avP --inplace --rsync-path="sudo rsync"
/root/stuff/ user at host2:/root/stuff/
This even works with sudo prompting for a password. Newer sudo
versions even have a distinct password prompt from ssh, so it's not
that confusing as in the past.
(I used this quite often when copying OpenVZ containers from one host
to another.)
If you still have serial consoles around, screen /dev/ttyS$n works,
usually better than minicom ;)
-ch
--
+43 680 2348846
http://christian.hofstaedtler.name/
More information about the Devops
mailing list