LinuxQuestions.org
Review your favorite Linux distribution.
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 12-25-2011, 03:24 AM   #1
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Rep: Reputation: Disabled
SSH connection issues on Ubuntu 10.10


Recently installed openssh-client & openssh-server on my ubuntu 10.10 box, and my backtrack 5 laptop, yet I can't connect to either host using ssh root@192.168.100.5. Keep getting the port 22 connection refused error, and yeah I have updated my port rules to allow 22 on both machines, thanks in advance
 
Old 12-25-2011, 03:32 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Most distro's do not allow root to ssh (does it work when using a normal, unprivileged user?).

Check if this is true in your case:
Code:
cd /etc/ssh
grep PermitRootLogin sshd_config
If this is set to no then root cannot ssh into the box. If this options is not present or set to yes, root should be able to log into the box.

Hope this helps.
 
Old 12-25-2011, 03:45 AM   #3
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
PermitRootLogin is set to yes on this machine, so i should just edit sshd_config to PermitRootLogin no and then ssh should work into this box ?
 
Old 12-25-2011, 03:52 AM   #4
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
edited /etc/ssh/sshd_config to as you suggested still with no luck either way between the machines
 
Old 12-25-2011, 04:14 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by I_LG_Ix View Post
PermitRootLogin is set to yes on this machine, so i should just edit sshd_config to PermitRootLogin no and then ssh should work into this box ?
No, that is not correct.

As stated before: If it is set to yes root login _is_ allowed. If set to no root login is _not_ allowed.

BTW: This should be done on the box you log into _AND_ you need to restart sshd to activate the changes made: /etc/init.d/ssh restart (could be sshd instead of ssh).

How about my other question (does it work when using a normal, unprivileged user)??

Hope this helps.

Last edited by druuna; 12-25-2011 at 04:22 AM. Reason: spelling
 
Old 12-25-2011, 04:33 AM   #6
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
sudo /etc/init.d/sshd restart is a command not found, and sudo /etc/init.d/ssh restart is a:

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart ssh
ssh start/running, process 11623

and as to your other question, my laptop does not have a user other than root, but i will create one and test out that too
 
Old 12-25-2011, 04:39 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by I_LG_Ix View Post
sudo /etc/init.d/sshd restart is a command not found, and sudo /etc/init.d/ssh restart is a:

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart ssh
ssh start/running, process 11623
This is informational, but does make a point. Use service ssh restart instead of what I suggested to get rid of the above message.

Quote:
and as to your other question, my laptop does not have a user other than root, but i will create one and test out that too
You might have heard this before but I'll mention it nevertheless: Do all your work as a normal user, only use root if you really have to!
 
Old 12-25-2011, 04:43 AM   #8
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
service ssh restart
restart: Rejected send message, 1 matched rules; type="method_call", sender=":1.68" (uid=1000 pid=11945 comm="restart) interface="com.ubuntu.Upstart0_6.Job" member="Restart" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))

: /
 
Old 12-25-2011, 04:50 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Have you tried:
Code:
sudo service ssh restart
 
Old 12-25-2011, 05:21 AM   #10
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
had to reset it twice before finally it reset haha, and yeah thanks i can now ssh to my ubuntu box from my backtrack laptop, however i still get a:

ssh: connect to host 192.168.100.5 port 22: Connection refused

when trying to connect from my ubuntu box to my backtrack laptop
 
Old 12-25-2011, 06:04 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

To recap:
Backtrack --> ssh --> Ubuntu : Does work.

Ubuntu --> ssh --> Bactrack : Does not work.

- Did you check sshd_config on your Ubuntu box?
- Is this true for both root and a normal user?
- Did you try after shutting down iptables/firewall?

Also: How did you install ssh on Ubuntu? Did you use Ubuntu's package manager (be it command line or GUI) or some other method?

Hope this helps.
 
Old 12-25-2011, 06:16 AM   #12
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Hi,
To recap:
Backtrack --> ssh --> Ubuntu : Does work.

Ubuntu --> ssh --> Bactrack : Does not work.
Correct

I did check my sshd_config as well as my ssh_config files.
No, I could only ssh from my backtrack machine to my ubuntu box on a normal user.
could you direct me as to how I would shut down iptables/firewall ?
and i used sudo apt-get install openssh-client openssh-server
 
Old 12-25-2011, 07:09 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by I_LG_Ix View Post
I did check my sshd_config as well as my ssh_config files.
No, I could only ssh from my backtrack machine to my ubuntu box on a normal user.
could you direct me as to how I would shut down iptables/firewall ?
I don't use Ubuntu and a quick search points out that both iptables and ufw can be used:
- Ubuntu - Iptables
- Ubuntu - Ufw and Iptables

But before you start tinkering with this: Have a look at your log files (in /var/log/), maybe there's a clue.

Quote:
and i used sudo apt-get install openssh-client openssh-server
I find it a bit strange that you had to install these packages, to my knowledge these (at least the client) are installed by default (Ubuntu SSH).

Hope this helps.
 
Old 12-25-2011, 07:29 AM   #14
I_LG_Ix
LQ Newbie
 
Registered: Dec 2011
Distribution: Ubuntu, openSUSE
Posts: 21

Original Poster
Rep: Reputation: Disabled
haha thanks a lot man, disabling the firewall and restarting ssh did it.
also please do excuse my ignorance kind of new to this stuff : )
 
Old 12-25-2011, 07:36 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by I_LG_Ix View Post
haha thanks a lot man, disabling the firewall and restarting ssh did it.
Now you know where the problem lies and you can fix it by editing your firewall rules (see the links I posted in my previous reply).
Quote:
also please do excuse my ignorance kind of new to this stuff : )
No problem, that's the reason why LQ exists

BTW: If this is solved can you put up the [SOLVED] tag.
first post -> Thread Tools -> Mark this thread as solved
 
  


Reply



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
ssh connection timing out Ubuntu 10.04 kells Ubuntu 6 11-15-2010 07:03 AM
SSH logon issues / Ubuntu / OpenSSH dave562 Linux - Server 5 04-26-2010 04:09 PM
Wireless Connection issues with Ubuntu 9.04 shiquemano Linux - Wireless Networking 7 10-05-2009 01:44 PM
Slow ssh connection over lan with Ubuntu Desktop and Ubuntu Server Recursion Linux - Networking 1 05-23-2009 02:17 AM
Ubuntu 5.10 PPPoE/VPN Connection Issues Schnoid Linux - Networking 0 04-27-2006 11:21 AM

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

All times are GMT -5. The time now is 02:57 PM.

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