# ssh variables
remote = 'carnd@54.89.247.182'
## ssh updated model and run model in remote host
# using sshpass to login, user carnd
login = 'sshpass -p "carnd"' # change carnd to password
! {login} scp ./model.py {remote}:Project/model.py
! {login} ssh {remote} 'cd Project; python3 model.py'
# alternative: using a certificate to login
cert = 'udacity-aws.pem' # change udacity-aws.pem to path to certificate
! scp -i {cert} ./model.py {remote}:Project/model.py
! ssh -i {cert} {remote} 'cd Project; python3 model.py'