dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
8747
share rss forum feed


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast

wget command in terminal to download files via ssh?

Frustrated!

I have been trying to learn the command line. I am able to ssh (local network only) into other computers in terminal (still messing with router settings... ask later)

I am able to navigate to the file that I want. but I have been trying to download it... after googling, it seems the best way to download files using Terminal is wget. I installed it with Brew. But now I am stuck on how to download a file with wget (or does it only download files with url's?)
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast

what is my end goal? I want to be able to be home, and download files from the computer in my office AND i think it would be cool if I were able to do it via Terminal. lol
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

wget is for http or ftp URLs, yes.

What you probably want to use is scp if the systems in question have ssh/sshd installed.

Then you could, from host #1:

scp host2:/path/to/file local/path/to/copied/file

If ssh/sshd is not an option, you may need to use NFS or Samba (windows file sharing) to accomplish it.
--
"I drank what?" -Socrates



bobrk
You kids get offa my lawn
Premium
join:2000-02-02
San Jose, CA
reply to nu2this

wget works great. You will probably have to read the man page to get the most out of it, though.

man wget



JohnInSJ
Premium
join:2003-09-22
San Jose, CA
reply to nu2this

you're looking for scp, not wget.



squircle

join:2009-06-23
Oakville, ON
reply to nu2this

As mentioned, you're looking for scp. The syntax is scp user@host:/path/to/file /destination/file.



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
reply to pflog

i tried scp but I may have done it wrong



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
reply to squircle

ahhhh... you just showed me what i missed... the colon between lemme try... thanks!



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast
reply to squircle

admin:Desktop admin$ scp admin@192.168.1.145:/Users/admin/Desktop/ENIGMA.jpg
usage: scp [-12346BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2

--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



dennismurphy
Put me on hold? I'll put YOU on hold
Premium
join:2002-11-19
Parsippany, NJ
kudos:2
Reviews:
·Verizon FiOS

said by nu2this:

admin:Desktop admin$ scp admin@192.168.1.145:/Users/admin/Desktop/ENIGMA.jpg
usage: scp [-12346BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2

Need a destination.

scp username@destination:/Path/To/File/On/Remote/Site/filename /Path/To/Destination/filename

for example:

scp fred@flintstone.org:/tmp/barneys-cell-phone-num.txt .

(the . is the current working directory, so it'll copy the file from flintstone.org to the current directory.


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL

YOU ARE AWESOME! thanks!
so freaking cool!

thank you so much!



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL

now on to the next issue... to do this outside of the network (from my home to the office)



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

said by nu2this:

now on to the next issue... to do this outside of the network (from my home to the office)

You will need to port forward port 22 on your router to the internal IP address of the machine you want to copy to/from. Then assuming your company doesn't have a firewall, you can do the same thing with scp.

If there's a firewall in place, depending on what OS at work you have, you can use putty or there are various proxy navigators you can plug into OpenSSH's .ssh/config file.

We need more info about your work setup and whether there's a firewall there preventing outbound connections to port 22.
--
"I drank what?" -Socrates


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast

Click for full size
I have a firewall...


pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

I believe the port forwarding for that router would be under "Applications & Gaming", but not 100% sure.

The firewall I was asking about was at your work. Does your work restrict connections only to port 80/443 (for web browsing) or is there a proxy configured in your browser at work in order to connect to web sites? Or do you connect directly with no proxy?
--
"I drank what?" -Socrates



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast
reply to pflog

on the cisco LInksys E2500 / Applications and Gaming tab... i went to single port forwarding

External Port 22
Internal Port 22
Protocol BOTH (tcp udp)
to IP Address (can't be left blank) it's all 192.168.1. (fill in last 3) only option

and then check the box to Enable

but I don't think this works from outside of the network.
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast
reply to pflog

it's my office. I don't have an IT guy... lol (me i guess) I haven't setup any firewalls (other then what is coming from the router as default and/or ISP COMCAST XFINITY as default. nothing extra.

I am running 10.8.2 on all my macs (office and home)
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3
reply to nu2this

Yes, it will if that's your only router. So now you should be able to, in theory:

ssh youruser@public_ip_on_router

If so, scp should work in the same manner. You won't be able to scp FROM home to work, but you can accomplish the same thing buy initiating the scp always from the work machine:

from work to home:

scp /path/to/local/file homeuser@home_public_ip:/path/to/file/at/home
 

and from home to work:

scp homeuser@home_public_ip:/path/to/file/to/copy /path/to/file/at/work
 

But this all depends whether your work blocks outbound port 22 or not...

--
"I drank what?" -Socrates


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast

how can i see if router port 22 is blocked? and can i try to connect to public ip from inside the office to test? or will it get errors?
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

said by nu2this:

how can i see if router port 22 is blocked? and can i try to connect to public ip from inside the office to test? or will it get errors?

Just get the external IP address of your home router (should show up via the web interface status). Then try to ssh from your work computer. You can add -vv to the command to see verbose output to see when it attempts to open the socket to connect. If it hangs, it's probably still being blocked/firewalled on your home connection.
--
"I drank what?" -Socrates


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast

I have two computers on my desk here at office.

I went to what's my ip address and got my public ip.
opened CyberDuck on other computer
chose SFTP ssh file transfer protocol
server (public ip address) port 22
username (of computer)
password (of computer)

not able to connect
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

No, that's the public IP of your WORK connection. If you're connecting to home, you need to get the public IP of your home connection.
--
"I drank what?" -Socrates



nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
reply to nu2this

i have tried ftp-ssl , ftp , ssh
i get network timed out and connection refused



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

said by nu2this:

i have tried ftp-ssl , ftp , ssh
i get network timed out and connection refused

Are you at work or at home when trying to ssh? Did you get the IP of your home connection?

home(HOME_external_ip)-----[internet]-----(WORK_external_ip)work

If you're AT work on "work computer", then you need to find out "HOME_external_ip" and then:

ssh usernameonhomecomputer@HOME_external_ip

It should work if you have properly forwarded port 22 on the home connection's router.
--
"I drank what?" -Socrates


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL
Reviews:
·Comcast
reply to pflog

i do not have the public IP of home connection. I am trying to do this using two different office computers (using public IP of one of these computers here in the office)
--
Why are you so surprised to see sinners in church? Are you shocked to see sick people in a hospital too?



pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

said by nu2this:

i do not have the public IP of home connection. I am trying to do this using two different office computers (using public IP of one of these computers here in the office)

That will not work. It takes special NAT rules to be able to access an external IP address from behind NAT. Simply, it's not going to work.

You will need to get he public IP of the home machine and port forward 22 there in order to ssh from work to home. If you want to ssh from home to work, then you need to port forward 22 there as well and need to know the external IP for whichever place you're connecting TO.

A dynamic dns service liked dyndns.org can help with this so you can configure your routers to update your dynamic hostname when they change IPs, so that you can connect via a host name instead of having to look up the IP address if it changes when DHCP leases are renewed (rare).
--
"I drank what?" -Socrates


nu2this
NOT
Premium
join:2005-04-07
Hallandale, FL

ok... thanks... i'll take this info that I have and try it later when I get home.

much appreciated!



Thinkdiff
Premium,MVM
join:2001-08-07
Bronx, NY
kudos:11

1 edit
reply to pflog

said by pflog:

said by nu2this:

i do not have the public IP of home connection. I am trying to do this using two different office computers (using public IP of one of these computers here in the office)

That will not work. It takes special NAT rules to be able to access an external IP address from behind NAT. Simply, it's not going to work.

That's not exactly true. Many consumer or entry-level business grade routers support NAT loopback by default. In my experience, the chances of it working are greater than the chances of it not working. That being said, unless you know your router supports it or has an option to specifically turn it on, you'll never know if your port forwarding is failing or the router is blocking it.

OP: If you have an iPhone, you can download Prompt, iSSH, or a free SSH client (if there are any) and try using your 3G connection. Or just wait until you get home
--
University of Southern California - Fight On!


pflog
Bueller? Bueller?
Premium,MVM
join:2001-09-01
El Dorado Hills, CA
kudos:3

My knowledge of SOHO routers is dated. I know that in the past it was not very likely to work on most. If that's changed, I stand corrected.
--
"I drank what?" -Socrates



aefstoggaflm
Open Source Fan
Premium
join:2002-03-04
Bethlehem, PA
kudos:3
Reviews:
·PenTeleData
·Verizon Online DSL
reply to nu2this

#1 Check what the networking info is on your computer.

As how to do that on a Mac, see

»osxdaily.com/2010/08/08/lan-ip-address-mac/

#2 Going to the Default Gateway (called router on the Mac) should take you to the Cisco Linksys e2500.

#3 If not, report back that fact and then you will be told what to do next.

#4 In the router go to Status -> Router Status

#5 In there, one of the IP Address should be the same IP Address that you see at this site at Tools -> Your IP address, IP whois

#6 If not, report back that fact and then you will be told what to do next.
--
Please use the "yellow (IM) envelope" to contact me and please leave the URL intact.