ssh tricks

ssh

  • allocate a pseudo tty: ssh -t <ssh_alias>  htop
  • ssh with sudo password:  http://www.cyberciti.biz/faq/linux-unix-bsd-sudo-sorry-you-must-haveattytorun/
    •  ssh -t ssh_alias ” echo secret | sudo -S dmidecode”
  • ssh-keygen -lf /etc/ssh/ssh_host_rsa_key : print the SSH server fingerprint

pssh (parallel-ssh) is good for non interactive ssh session multiplexing

  • sudo apt-get install pssh; alias pssh=’parallel-ssh’
  • parallel-ssh -h hosts.txt -i -x “-t -t” cat /etc/release
  • parallel-ssh -h ling2 -i -x “-t -t” “sudo service cloudera-scm-agent restart”
  • ssh -t -t is used for forcing tty  allocation so that sudo ssh can work remotely.
  • parallel-scp -h host.txt -v foo.tar.gz /home/bar
  • parallel-slurp -v -h $HOST_FILE -L conf remote_file_full_path local_file_name
Advertisements
This entry was posted in ssh and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s