Shell: May 2016 Archives

XML formating

Vote 0 Votes

| xmllint --format - # need libxml2 package
| xmlstarlet fo # need xmlstarlet
Make it more readable.

JSON formating

Vote 0 Votes

| python -m json.tool # need python package
| jq . # need jq package
Make it more readable.

Server Side sshd_config
ClientAliveInterval 60
ClientAliveCountMax 3


Client Side ssh_config
ServerAliveInterval 60

ssh user@host bash -s -- <

You can add arguments if you need.
ssh user@host bash -s -- < argv1


Vote 0 Votes

一般是建 Key 來達成 ssh 免密碼, 若不想建 Key, 可以用 sshpass
sshpass 可以在 ssh 時自動將密碼帶入
密碼可以用檔案(-f filename)或參數(-p password)或變數SSHPASS(-e)帶入
sshpass -f pass_file ssh
sshpass -p password ssh
export SSHPASS=password
sshpass -e
當然也可以直接執行所連線主機的 command
sshpass -e cat /etc/hosts

About this Archive

This page is an archive of entries in the Shell category from May 2016.

Shell: April 2016 is the previous archive.

Shell: June 2016 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives