linux nerds: true or false: if I'm ssh'd into a linux machine from a windows machine and I want to use scp to move a file from linux -> windows, I should be able to, whether or not I'm running an ssh server on my windows machine?
@sirgeefive hmm--the scp I'm invoking is on the linux machine tho. I'm wanting to push the file from linux -> win.
If I open a new command prompt, I can use windows' scp client to pull from linux into windows. But then I have to enter passwords & specify gnarly paths & whatnot. My feeling is I've already got an authenticated session going--why can't I just use that?
(I'm using the openssh install that comes standard w/windows these days, if that's important.)
@rpardee I mean personally, I would flip the transaction and pull from the linux with the windows client. Having said that:
ssh user@remote_host -t "scp local_file remote_user@remote_host:/remote/path"
You can execute a remote command over the existing ssh session as above by using the -t flag. So, you could use your existing session to run scp.
@sirgeefive woah--trippy! So that sends the scp command to my windows host to do a pull from linux into windows?
@rpardee Yeah, it sends any command. In that example it was sending the scp command.
@rpardee just use WSL.
@AI78 I do have that installed--would it make a difference if that's the environment I ssh'd into the remote linux host tho?
@rpardee I use WSL for all my console-y things and have used it to scp files down.
Also sshd by default also supports SFTP if you want it even easier.
@rpardee Not console-y... terminal-y... ugh it's been a long day/week/month.
@AI78 judging you, super-hard rn
🤣
@rpardee I'll take it bud.
@rpardee Your scp client on your windows box should be able to copy independent of any ssh server you are running. If you are running a cygwin variant on your Windows box, this shouldn't be a problem at all. PuTTY can be a little trickier, but I don't recall ever having problems with scp to or from linux.