分号
ssh User@Host 'source /etc/profile; date'
写EOF
ssh User@Host /bin/bash << EOF
date
ls -la
uptime
EOF
使用脚本
echo 'date' > 1.sh
ssh User@Host bash -s < 1.sh
ssh User@Host 'source /etc/profile; date'
ssh User@Host /bin/bash << EOF
date
ls -la
uptime
EOF
echo 'date' > 1.sh
ssh User@Host bash -s < 1.sh