LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 4
Posts: 4,297

Rep: Reputation: 205Reputation: 205Reputation: 205
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
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
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 13.37 Android 4.0
Posts: 2,248

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

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

Rep: Reputation: 189Reputation: 189
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: Nuremberg, Germany
Distribution: Debian, Gentoo
Posts: 294
Blog Entries: 1

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
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration