sshpass -p [yourpassword] scp -r [username]@[address]:[pathinserver] [localpath]
Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts
How to use password in scp?
We can use sshpass to give the password when using scp to transferring files from server to local.
Putty SSH remote server with password in Windows
putty.exe -ssh [username]@[host] -pw [yourpassword]
screen -S [screename ] -X quit
You can also run some commands immediately after logging into the server.
putty.exe -ssh [username]@[host] -pw [yourpassword] -m [yourfiilename]
You can edit the file with [yourfiilename ] with commands you need to execute, e.g., a file contains commands for ending a screen
Keep process running after ending the ssh session using "screen"
Simple scenario from askubuntu :
into your remote box. Typessh screen
the process you want.Then start - Press Ctrl-A then Ctrl-D. This will "detach" your screen
leave your processes running. You can now log out of the remote box.session but - If you want to come back later, log on again and type
screen -r
This will "resume" your screen session, and you can see the output of your process. However, if you have multiple screens have been detached before, you might get this below:

- In this case, just specify the screen you want to re-attach
-r 174044.pts-3screen srvgal107.
- Kill screen session
Press Ctrl-A then K.: - Access
screenattatched screen -D -r '1234.: 'somescreensession - Scroll inside
screen - Maybe there's a better way, but I'm used to scrolling using the "copy mode" (which you can use to copy text using screen itself, although that requires the paste command too):
- Hit your screen prefix combination (
C-a
/ control+A by default), then hit Escape. - Move up/down with the arrow keys (↑ and ↓).
- When you're done, hit Return twice to get back to the end of the scroll buffer.
(If you move the cursor after hitting Return once, you'll be selecting text to copy, and hitting Return the second time will copy it. Then you can paste withC-a
followed by]
) - Quite a session: screen -X -S [session # you want to kill] quit
Subscribe to:
Posts (Atom)