This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e

View file

@ -0,0 +1,18 @@
ssh
For connecting to remote device
`ssh user@<host>` then type password if no ssh keys setup
non interactively with password
1. install sshpaas https://github.com/kevinburke/sshpass
for deb [sshpass_1.10-0.1_amd64.deb](../../../_resources/sshpass_1.10-0.1_amd64.deb)
2. use this command
`sshpass -p 'mypassword' scp myblogs.7z root@192.168.1.4:/root/projects/static/`
more secure way
```sh
export SSHPASS='mypassword'
sshpass -e scp myblogs.7z root@ 198.12.73.213:/root/projects/static/
unset SSHPASS
```
3. for running commands non interactive
`ssh user@host "command"`