LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2007, 09:22 AM   #1
BlackBone
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Rep: Reputation: 0
Unable to connect via ssh


Hi all, this my first post

I want to connect via ssh using a pc inside the network, but "Access denied". Tried both with root and user login both of them getting the same message.

Any suggestion what should I do to enable the connection? Thanks.
 
Old 08-24-2007, 09:52 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by BlackBone View Post
Hi all, this my first post

I want to connect via ssh using a pc inside the network, but "Access denied". Tried both with root and user login both of them getting the same message.

Any suggestion what should I do to enable the connection? Thanks.
What are you typing to try and log on? Are both machines GNU/Linux machines?
 
Old 08-24-2007, 09:55 AM   #3
BlackBone
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Original Poster
Rep: Reputation: 0
im using a program Putty on Windows XP machine trying to connect to my mail server, redhat fedora core 2
 
Old 08-24-2007, 10:02 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Hi and welcome to LQ.

Is your firewall configured to allow ssh connections and is the ssh daemon running on the server?
 
Old 08-24-2007, 10:08 AM   #5
BlackBone
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Original Poster
Rep: Reputation: 0
ty reddazz for the welcome,

yes the firewall is on and block ssh, but i dont think it is due to firewall because i tried to connect from internal network (not so sure though)

for ssh daemon, how can i check and disable ssh? thanks

Last edited by BlackBone; 08-24-2007 at 10:09 AM.
 
Old 08-24-2007, 10:43 AM   #6
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 -current
Posts: 2,300

Rep: Reputation: 90
The firewall must be configured to allow ssh

sshd must be running
 
Old 08-24-2007, 11:34 AM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Could check the webserver to see if sshd is listening on port 22..

Code:
it-etch:~# netstat -alnp | grep ::22
tcp6       0      0 :::22                   :::*                    LISTEN     2992/sshd
 
Old 08-24-2007, 01:34 PM   #8
sparc86
Member
 
Registered: Jul 2006
Location: Joinville, Brazil
Distribution: Debian, CentOS
Posts: 301

Rep: Reputation: 31
If you understand the iptables/firewall rules, then check if ssh is allowed to the internal networks, otherwise please copy us the iptables/firewall rules.

Last edited by sparc86; 08-24-2007 at 01:37 PM.
 
Old 08-24-2007, 08:59 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
iptables -L will list the rules for you

Code:
debianetch:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
an output like this one means there are no rules defines so the firewall is not blocking anything





general query.. was fedora using selinux in core 2 ? if so could this be cause by a policy set in selinux ? I really need to play with selinux sometime in the near future to become familiar with it and it's policies..
 
Old 08-25-2007, 06:28 AM   #10
BlackBone
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Original Poster
Rep: Reputation: 0
hi all, many thanks for the replies

i have edit sshd_conf file in /etc/ssh

below what i changed
PermitRootLogin yes
AllowUsers myuseraccount

after restart the service i manage to login from user , but still Access Denied using root


From the server desktop environment under Systems Setting => Security Level, I have enable SSH and restart, still the same, and i doubt this has any effect at all

From my windows pc, using internet explorer i can browse the firewall settings (we using Symantec firewall) with Admin login and can see that SSH and port 22 is allowed.

Below is what i capture from iptables -L , but im not sure what does it mean =/

[root@mail root]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@mail root]#

using nestat command i get this

[root@mail root]# netstat -alnp | grep ::22
tcp 0 0 :::22 :::* LISTEN 2599/sshd

but we dont have a webserver we only use it for mail server



should i change anything in this iptable? thanks. reason i want to enable root login so that i can access it from my house

Last edited by BlackBone; 08-25-2007 at 06:39 AM.
 
Old 08-25-2007, 08:30 AM   #11
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Many apps disable remote logins by root for security reasons. Its usually recommended that you login as a normal user and then switch to root using su.
 
Old 08-25-2007, 09:03 AM   #12
BlackBone
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Original Poster
Rep: Reputation: 0
yes you are rite after doing some reading i realise i shuldnt use root to ssh from my house, i can consider my problem is solved because i manage to connect as user then twitch to root using su root command

anyhow im still a bit concern to know if i really want to do a ssh to root from internal or even external network, what settings should i change (just for my knowledge), is it the iptable?
 
  


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
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM
Apache - unable to connect, ssh ok feltdd Linux - Software 5 05-18-2006 04:03 PM
unable to connect to my linux router from internet using ssh shkkhanhyd Linux - Security 3 03-31-2004 09:44 PM
unable to connect with ssh except to localhost Yaukuai Linux - Software 0 09-30-2001 06:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:05 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