openSUSE Forums > Archives > SF Archives > ARCHIVES - Network/Internet » How Do I Do A Basic Ssh Into Another Computer?

Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Network/Internet Questions regarding network or Internet configuration and use in SUSE Linux

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-May-2008, 08:23
BNG22908
Guest
 
Posts: n/a
Default

I am trying to get my parents to use Linux. They don't know how to install programs yet or do complicated things such as managing security or setting up things. So I want to be able to log into their computer from my Linux computer at my own house. I've never used SSH much before. I've been reading the man page though, and websites. From what I gather, I just type:

"ssh username@TargetHostname" , where username is the user name of my parents' computer, and TargetHostname is their hostname. Then I think I just enter their username password and I'm in, then I can su to root on their machine.

Is it really that easy? What if someone else has the same hostname, by some chance or accident? I have to make sure I have a hostname that no one else will have?

Also, what if I want to use scp (secure copy) to send them a file containing their favorite tv show or something? Wikipedia says:

Quote:
Copying file to host:

scp SourceFile.ext user@host:directory/TargetFile.ext

Copying file from host:

scp user@host:folder/SourceFile.ext TargetFile.ext
[/b]
Is there more to it than that or is that all I do?
  #2 (permalink)  
Old 30-May-2008, 08:28
ken_yap
Guest
 
Posts: n/a
Default

You cannot choose the domainname. You only have an IP address. So you would do

ssh user@12.34.56.78

for example. If you want a domainname that is easier to remember and also more importantly, will track any changes in your parent's dynamic IP, then you need a dynamic DNS service. There are some free ones out there.

More complications: If you parents have a gateway router, then you need to portforward the ssh port to the computer in question. And you should take some precautions with the ssh service, like barring root logins, using strong passwords (or better still a public/private key pair), and choosing a different port for access (the portforwarding can do this mapping also.)
  #3 (permalink)  
Old 30-May-2008, 08:37
Rhaddamant
Guest
 
Posts: n/a
Default

Quote:
I am trying to get my parents to use Linux. They don't know how to install programs yet or do complicated things such as managing security or setting up things. So I want to be able to log into their computer from my Linux computer at my own house. I've never used SSH much before. I've been reading the man page though, and websites. From what I gather, I just type:

"ssh username@TargetHostname" , where username is the user name of my parents' computer, and TargetHostname is their hostname. Then I think I just enter their username password and I'm in, then I can su to root on their machine.

Is it really that easy? What if someone else has the same hostname, by some chance or accident? I have to make sure I have a hostname that no one else will have?

Also, what if I want to use scp (secure copy) to send them a file containing their favorite tv show or something? Wikipedia says:
Is there more to it than that or is that all I do?
[/b]
perhaps you will find this helpful
  #4 (permalink)  
Old 30-May-2008, 08:59
oldcpu
Guest
 
Posts: n/a
Default

I maintain my mother's computer (which is running openSUSE linux in one of its boot partitions) a continent away using ssh, vnc, and nx. Here is a thread which explores this issue:
http://forums.suselinuxsupport.de/in...howtopic=63503

Having typed that, I thought Ken_Yap summarized a lot of the issues quite well. In particular, note what he had to state about a gateway router complication (with portforwarding/mapping possibly being required).
Quote:
More complications: If you parents have a gateway router, then you need to portforward the ssh port to the computer in question ..... and choosing a different port for access (the portforwarding can do this mapping also.) [/b]
On my home PC, for example, I have our "gateway-router's" (which connects to the ISP)
* port#41001 mapped to port#22 on PC#1 at home, and
* port#41002 mapped to port#22 on PC#2 at home, and
* port#41003 mapped to port#22 on PC#3 at home.

To ssh in to home PC#3 from outside (say at a hotel), to my "oldcpu" user account, I simply type:
<span style="font-family:Courier New">ssh -X oldcpu@myhomenetwork.net -p 41003</span>

On my mother's home LAN, its much easier, since her PC is the only on the LAN. Hence her "gateway-router's" mapping is set to go direct to her PC.

In order to use "myhomenetwork.net" I had to use the dyndns service that Ken_Yap referred to. Actually, my home LAN is not called "myhomenetwork.net". ... thats just an example. In fact, it has another name.
  #5 (permalink)  
Old 30-May-2008, 09:09
ken_yap
Guest
 
Posts: n/a
Default

Quote:
To ssh in to home PC#3 from outside (say at a hotel), to my "oldcpu" user account, I simply type:
<span style="font-family:Courier New">ssh -X oldcpu@myhomenetwork.net -p 41003</span>
[/b]
And you can set up a host entry in .ssh/config so that the hostname is mapped, the port and user are prespecified, and other options activated, to make life easier. Something like this

Host home3
Hostname myhomenetwork.net
Port 41003
User oldcpu
ForwardX11 yes

Then, irrespective of your login name, you can just do:

ssh home3

and it has the same effect as what oldcpu wrote above. You can put all sorts of other options in there too.
  #6 (permalink)  
Old 30-May-2008, 12:38
BNG22908
Guest
 
Posts: n/a
Default

Thanks for all your help. I wanted to put a host entry in .ssh/config, but there is no config file in the .ssh folder.

Quote:
[user@localhost .ssh]$ pwd
/home/user/.ssh
[user@localhost .ssh]$ ls -la
total 12
drwx------ 2 user user 4096 2008-05-31 13:30 ./
drwx--x--x 48 user user 4096 2008-05-31 13:30 ../
-rw-r--r-- 1 user user 391 2008-05-30 14:43 known_hosts[/b]
Should I type "touch config" in the shell to create the config file in /home/user/.ssh ?

Also, my parents only have a DSL box that's a little larger than my hand. It just has one phone cable going in and the ethernet cable coming out. Do I have to port forward through that, or does that not act as a router?
  #7 (permalink)  
Old 30-May-2008, 15:09
oldcpu
Guest
 
Posts: n/a
Default

Quote:
Also, my parents only have a DSL box that's a little larger than my hand. It just has one phone cable going in and the ethernet cable coming out. Do I have to port forward through that, or does that not act as a router?
[/b]
Simply looking at cables and box size is not a criteria for determining what it does.

You need to spend the time looking at it, read its brand name, model number, and figure out what it does.

You need to determine is that just a "modem" or is it a combined "router/modem" ?

Does your parent's PC connect to the internet (via that DSL box) using PPoE ? (ie point-to-point over ethernet, which would be the case if it is just a DSL modem), or do they use normal ethernet to a router? In both cases the cable will be an ethernet cable. .. So you can not deduce this by just looking at cables.
  #8 (permalink)  
Old 30-May-2008, 18:35
ken_yap
Guest
 
Posts: n/a
Default

.ssh/config doesn't exist out of the box. It's fine to create it.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2