LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Some simple questions about SSH (https://www.linuxquestions.org/questions/slackware-14/some-simple-questions-about-ssh-793757/)

mutexe 03-07-2010 05:19 AM

Some simple questions about SSH
 
Hiya,
Never dabbled in SSH before, so apologies if these are stupid questions.
1. I can connect to my slack 13 laptop via PuTTY on my GF's windows laptop. Can I actually copy things from my laptop to her machine using 'scp', or is PuTTY just used for browsing my linux filesystem on a windows machine? Google has been telling me about some software called 'WinSCP', which can copy files over, but I was just wandering if i can do this anyway using PuTTY?
2. The first time i did connect to my laptop from my GF's laptop (and also my ubuntu desktop) I get the warning about the host key is not cached in client machine("the server's rsa2 key fingerprint is: ssh-rsa XXXX xx:xx:xx:xx:xx:xx: etc etc). I understand why this happens, but I have no idea where to find this value on my host laptop. I can find the actual key, but not the fingerprint (i.e. the xx:xx:xx:xx:xx:xx:xx" etc). Can anyone tell me where I can find this please, as i blindly typed "yes" to get SSH working?
3. When i connect from the internet (rather than over my home network) will i need some kind of 'shell login account' to do this cuz i dont have a static IP. ie i'd like to do 'ssh tom@myAccount.com' rather than 'tom@123.432.32.23'? Where or how can i make this happen?

Many thanks in advance,

Tom

bgeddy 03-07-2010 05:49 AM

I've been playing with Putty a bit lately and have found it very useful. I'll attempt to answer each of your points in turn.
1) You can use several ways to copy stuff around with putty. There psftp which looks like ftp on the client end but works over ssh. You can move files around with this. Putty also has the tool "pscp" which I use a lot to copy stuff from my linux host (just like scp on Linux).

2) I'm not sure about this value as I just type "yes" as you did and I'm not expert in ssh.

3) You should look at Dyndns which gives you a host name and lets you quickly and easily update the dns record as your hosts IP changes - there are even tools and scripts to do this. This means you could access your server via a URL. I would be VERY careful about opening ssh to the world though - it is open to abuse.

mRgOBLIN 03-07-2010 06:12 AM

You'll need to be root to do this...

Code:

cd /etc/ssh
ssh-keygen -l -f ssh_host_rsa_key


niels.horn 03-07-2010 10:14 AM

@mutexe: Check out Dyndns as bgeddy mentioned and use inadyn to keep your dns record updated automatically, even if it changes while you're not at home.

mattca 03-07-2010 11:33 AM

1. Not sure if this will be an option from a windows machine or not, but I use sshfs to transfer files via ssh. It connects a mountpoint (a directory) you specify to your home directory on the remote machine. So when you "ls" the directory on the local machine, you'll see all your files on the remote machine. It's very handy :)

niels.horn 03-07-2010 11:49 AM

And there is always the option to use cygwin on windows, so that you can use the normal ssh & scp commands.

mutexe 03-07-2010 12:13 PM

Thanks all. You've given a lot to look up and learn.

Thanks again,

Tom

mutexe 03-07-2010 03:16 PM

Hi again,
Got me a DNS host from that site, but when I type 'ssh myHostName.HomeLinux.com' in putty it dont do anything, just seems to hang.
I've looked at the FAQs on dynDNS.com and cant see if i have to configure it some more?
Any ideas?

Cheers again,

Tom

niels.horn 03-07-2010 03:34 PM

Did you set your IP address for that domain on the dynDNS site?

If you do a "dig myHostName.HomeLinux.com", do you get the right IP address?

Setting the IP address for your domain can be done automatically with the inadyn client as well...
If you don't want to compile inadyn, you can grab it from my site (see link in my signature).

michaelk 03-07-2010 03:44 PM

1. PuTTY is a remote access client only. You can also down load from the same site as PuTTY command line programs pscp or psftp.

2. This might help http://www.securityfocus.com/infocus/1806

3. If you ping myHostName.HomeLinux.com (use your real URL) you should see your IP address. If using a router it will be your WAN IP address. Is the dynDNS client running? If using a router did you configure it to forward IP address and you also configure your linux box with a static IP address?

mutexe 03-07-2010 03:57 PM

thanks again for the help :)

Code:

bash-3.1$ dig myname.homelinux.com

; <<>> DiG 9.4.3-P4 <<>> myname.homelinux.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12367
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;myname.homelinux.com.      IN      A

;; ANSWER SECTION:
myname.homelinux.com. 60    IN      A      <my eternal IP is here>

;; Query time: 58 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Sun Mar  7 21:44:39 2010
;; MSG SIZE  rcvd: 57

Does that means it's working ok? I dont have much networking knowledge i'm afraid.

Should anything happen if i do a 'http://myname.homelinux.com' in a browser??

CHeers,

Tom

PS I was gonna look at inadyn once i'd got the DNS working :)

niels.horn 03-07-2010 04:10 PM

Quote:

Originally Posted by mutexe (Post 3889514)
Does that means it's working ok? I dont have much networking knowledge i'm afraid.

If it gives the correct IP address, yes :)

Quote:

Originally Posted by mutexe (Post 3889514)
Should anything happen if i do a 'http://myname.homelinux.com' in a browser??

Only if you have httpd running on your server, and if your ISP does not block access to port 80 (mine does...)

mutexe 03-07-2010 04:29 PM

yep it gives the correct IP :)

But
Code:

ssh tom@myName.homelinux.com
still does not work (just hangs).

I used https://www.dyndns.com/support/tools/openport.html with my IP and port 80 and got this:
Quote:

An attempted connection to <my ip address>:80 was refused. This typically indicates that there are no services available on that port, but that it is NOT being blocked by a firewall or your ISP.


Tom

niels.horn 03-07-2010 04:32 PM

OK, you can start httpd with "sh /etc/rc.d/rc.httpd start", try again, and stop it afterwards with "sh /etc/rc.d/rc.httpd stop"

It should give a simple page with something like "It works!" :)

michaelk 03-07-2010 04:43 PM

Here is another check you can perform.

telnet myName.homelinux.com 22

You should see a response similar to the following.
Trying xxx.xxx.xxx.xxx...
Connected to myName.homelinux.com
Escape character is '^]'.
SSH-2.0-OpenSSH_4.7


All times are GMT -5. The time now is 08:32 PM.