file: ~/.ssh/config
Host ela
HostName ela-webdev.local
Port 22
User develop
Call it with:
ssh ela
Copy public key from the client to the remote host to the file ~/.ssh/authorized_keys and change the file permissions to 644 to avoid password input.
scp ~/.ssh/id_rsa.pub user@remotehost:~/.ssh/authorized_keys
ssh user@remotehost chmod 644 ~/.ssh/authorized_keys
targethost="www.domain.xxx";
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@$targethost '
cd /tmp;
if [ -d "'$tmpdir'" ]; then rm -rf '$tmpdir'; echo "remove tempdir on remote: '$tmpdir'"; fi;
if [ -e "'$tmpfile'" ]; then rm '$tmpfile'; echo "remove tempfile on remote: '$tmpfile'"; fi;
';