LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-22-2008, 03:15 PM   #1
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Rep: Reputation: 24
ssh between two machines booted with live distros


Is this possible?

I have two machines and boot them with various live distros (one at the time ), but when I try to connect with ssh, I seem to invariably get "ssh: <whatever>: Name or service not known".

Using ssh between a live and an installed system works here. If it is possible to use ssh between live/live systems, I would be very interested in example(s) of ssh commands...! TIA!!

Last edited by Paraply; 03-22-2008 at 03:17 PM.
 
Old 03-22-2008, 04:25 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
You would most likely need to start the SSH daemon before it would accept connections. Which liveCD are you using? Look in /etc/init.d/ for an ssh script... "sudo /etc/init.d/ssh start" should work on Ubuntu or derivatives.
 
Old 03-22-2008, 05:26 PM   #3
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by ranger_nemo View Post
You would most likely need to start the SSH daemon before it would accept connections. Which liveCD are you using? Look in /etc/init.d/ for an ssh script... "sudo /etc/init.d/ssh start" should work on Ubuntu or derivatives.
Thank you. Yes, I have made sure that SSH is active on both machines, and there is no problem connecting live/installed or vice versa, but when both machines are booted with a live distro I can't get it to work...

The distros I've tried are Frugalware 0.8, Wolvix 1.1 and SLAX 6.0.3; i.e. Slackware derivatives. Maybe it is just impossible...
 
Old 03-22-2008, 07:14 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Paraply
I have two machines and boot them with various live distros (one at the time ), but when I try to connect with ssh, I seem to invariably get "ssh: <whatever>: Name or service not known".
Can you copy/paste the exact command you're typing, and the exact error message you're seeing?

There is no reason you should not be able to ssh between 'live' boxes, assuming sshd is running, accepting tcp connections on the interface you think it is, a hole is poked in the firewall, the boxes are on subnets that can reach one another, etc., etc.
 
Old 03-22-2008, 08:57 PM   #5
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I would bet it is a firewall issue. Can't say for sure but I would expect a live CD to come up in a pretty secure mode.
 
Old 03-22-2008, 09:08 PM   #6
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by anomie View Post
Can you copy/paste the exact command you're typing, and the exact error message you're seeing?

There is no reason you should not be able to ssh between 'live' boxes, assuming sshd is running, accepting tcp connections on the interface you think it is, a hole is poked in the firewall, the boxes are on subnets that can reach one another, etc., etc.
Machine 1: SLAX Live, ifconfig shows 10.0.0.33
Machine 2: Wolvix Live, ifconfig shows 10.0.0.35

ssh is activated automatically during boot in both distros (in Frugalware I have to issue "service sshd start").

I am in root@slax and root@wolvix, respectively.

Trying e.g. "ssh root 10.0.0.35" from M1, gives "ssh: root: Name or service not known". I have tried other combinations, like "ssh root@10.0.0.35", "ssh 10.0.0.35: /root", and so on, but always get the same reply.

Is there a network configuration setting in the live distros which disallows remote entrance to root?

None of these distros has a preconfigured user; only root. If I could easily make a user, I could perhaps connect to user and su to root?

Any advice is welcome

Last edited by Paraply; 03-22-2008 at 09:17 PM.
 
Old 03-22-2008, 09:39 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Paraply
I have tried other combinations, like "ssh root@10.0.0.35"
When you use that exact command, what is the exact error message? (I doubt it's the same as the other - incorrect - usages.)

Also, on the box you're attempting to ssh to, what do the following commands show:

# pgrep sshd

# iptables -nvL
 
Old 03-23-2008, 06:26 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
Is there a network configuration setting in the live distros which disallows remote entrance to root?
Yes, and it's in /etc/ssh/sshd.conf "PermitRootLogin"
Quote:
If I could easily make a user, I could perhaps connect to user and su to root?
That is usually how it is done, as this is more secure than allowing root logins over ssh.
The command you will need is ssh username@10.0.0.35 or whatever the IP of the other computer is.
 
Old 03-23-2008, 10:06 AM   #9
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by tredegar View Post
Yes, and it's in /etc/ssh/sshd.conf "PermitRootLogin"
OK, but I never manage to save and exit vi... Can't understand why not all distros come with nano. Care to tell me how?

Quote:
That is usually how it is done, as this is more secure than allowing root logins over ssh.
The command you will need is ssh username@10.0.0.35 or whatever the IP of the other computer is.
Hmm... How do I create a user in a live distro? Just "adduser <somename>"? Yes, I am a Linux newbie... And when I exit from root, will I then be the user? And if that happens, will I get back in root just by issuing "root", since no root password is set up in the live distro, or must I create a password for root?
---

Edit: I seem to have been able to uncomment "PermitRootLogin yes", but trying to log in to SLAX gives this:

root@x__x:/# ssh root 10.0.0.36
ssh: root: Name or service not known
root@x__x:/# ssh root@10.0.0.36
ssh: connect to host 10.0.0.36 port 22: Connection refused
root@x__x:/# ssh slax@10.0.0.36
ssh: connect to host 10.0.0.36 port 22: Connection refused
root@x__x:/#

Last edited by Paraply; 03-23-2008 at 10:50 AM.
 
Old 03-23-2008, 10:13 AM   #10
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by anomie View Post
When you use that exact command, what is the exact error message? (I doubt it's the same as the other - incorrect - usages.)

Also, on the box you're attempting to ssh to, what do the following commands show:

# pgrep sshd

# iptables -nvL
What I said about the error messages being the same was probably not true, but said in desperation. I will come back with answers to your questions when I have booted to the live distro on this machine.

Meanwhile I have tried the commands in the SLAX Live on the other machine (which I cannot connect to, even after the change in sshd_config):

root@slax:/# pgrep sshd
root@slax:/#

root@slax:/# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
root@slax:/#

Last edited by Paraply; 03-23-2008 at 11:20 AM.
 
Old 03-23-2008, 12:23 PM   #11
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by anomie View Post
When you use that exact command, what is the exact error message? (I doubt it's the same as the other - incorrect - usages.)

Also, on the box you're attempting to ssh to, what do the following commands show:

# pgrep sshd

# iptables -nvL
I have now booted to Frugalware 0.8 Live on this machine and run the commands:
# pgrep sshd
6660

# iptables -nvL
--> gives the same reply as SLAX and as copied in my last post.

In Frugalware, one can log in as user ("fwlive") or root ("root"), with given passwords. When, from SLAX, I issue:

root@slax:/# ssh fwlive@169.254.133.235

a connection seems to be opened (I get no messages, no prompt), but commands, like "ls", "root" or "su", do nothing except appear printed on the screen. The prompt does not return. However, after a while, I get this message: "ssh: connect to host 169.254.133.235 port 22: Connection timed out"

Might the reason be that Frugalware gets that inet address, and not the usual 10.0.0.xx other live distros get, and that ssh does not get a DNS match for it?? Just a wild guess...

Also, when I boot Frugalware on my other machine, it does get a 10.0.0.xx inet address, and I can log into Frugalware on that machine from Linux *installed* on another machine...
 
Old 03-23-2008, 12:32 PM   #12
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
OK, but I never manage to save and exit vi...
Escape key and then type :wq
There are lots of vi(m) tutorials on the web

ssh will tell you how it is trying to connect if you use the -v option:
ssh -v user@IP.ADD.RE.SS
-vv will give you very verbose reporting and so on.
 
Old 03-23-2008, 12:39 PM   #13
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
root@slax:/# ssh fwlive@169.254.133.235
ssh: connect to host 169.254.133.235 port 22: Connection timed out
Is the sshd running on the machine at 169.254.133.235?

Also note that if you are going to make a change to the sshd.conf file, you need to restart the sshd for the change to be recognised, usually with /etc/init.d/ssh restart
 
Old 03-23-2008, 01:02 PM   #14
Paraply
Member
 
Registered: Jun 2007
Location: Norway
Distribution: Arch Linux
Posts: 111

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by tredegar View Post
Is the sshd running on the machine at 169.254.133.235?

Also note that if you are going to make a change to the sshd.conf file, you need to restart the sshd for the change to be recognised, usually with /etc/init.d/ssh restart
Thank you for this and your other post. Very useful!
Yes, I finally found out about "Esc" and ":wq". I shall say nothing more about vi(m). For now...

I suspected I would have to restart sshd after the config change, but I only did "/usr/sbin/sshd". Will try your suggestion.

When I boot to Frugalware and su to root, I start sshd by "service sshd start". I do a ifconfig before or after starting sshd. So, yes, sshd is running on the machine where ifconfig reports 169.254.133.235 - I get a message saying something like "Starting sshd daemon". Besides, I have successfully used the same procedure with Frugalware booted on my other machine and connecting to it from my main (this) machine using Bluewhite64 installed.

I tried "/etc/init.d/ssh restart", but no go.
"which" says it cannot find any instance of "init.d"...

Last edited by Paraply; 03-23-2008 at 01:10 PM.
 
Old 03-23-2008, 01:16 PM   #15
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I shall say nothing more about vi(m). For now...
Very wise

I don't know anything about frugalware, but it seems that you should restart the sshd with
service sshd restart
not
/etc/init.d/ssh restart
Which is a debian (k)ubuntu thing.

I am puzzled as to what it is that you are trying to do.

You have some strange choices of distros for a newbie, (which means that I do not automatically know that you need the service sshd restart thing for example), although there is nothing inherently wrong with that.

Why are you running from live distros? They are a PITA for anything except seeing if your hardware is detected properly, and fixing-up really bad fsck-ups.

Why are you trying to ssh as root?

What, exactly, are you trying to achieve?
 
  


Reply

Tags
distro, live, networking



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux distros compatible with macintel machines? greggc15 Linux - Newbie 3 01-10-2007 05:47 PM
Old versions of linux distros - is it a good idea to use them on old machines? pwc101 Linux - Laptop and Netbook 4 02-28-2006 04:54 PM
tried multiple distros of linux. none booted ldouble Linux - Newbie 6 02-25-2006 06:43 AM
Booted suse live dvd-after hardware config nothing? spider2050 SUSE / openSUSE 1 08-28-2005 05:25 PM
Migrating data and settings between distros or machines kainhart Linux - General 0 07-01-2004 10:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration