LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-26-2003, 10:40 PM   #1
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
ssh stuffs


hey guys,

i have setup a linux box far from a city, RH8. from the iptables point of view, i have opened up port 22 for ssh. now, i am living in other city, and would like to ssh this linux box from internet.
how am i going to do? i've tried to ssh the adsl ip which dedicated for the linux box, but fail. from outside, i've try to nmap the opening port, but also failed.
now, i want to do remote control from here, how?
pls, help... this is urgent! thanks for any helps and concerns.
 
Old 06-27-2003, 09:20 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
1. Did you start up the ssh client or the ssh server (sshd) on the linux box? You'll need to have the daemon started if you want to ssh in.

2. Make sure the daemon is really on:
chkconfig --list | grep sshd
It should say "on" for run levels 3 and 5
Then do:
service sshd restart

3. Make sure it's listening properly:
netstat -lan
You should see something actively listening on port 22

4. Make sure your firewall isn't blocking port 22:
more /etc/sysconfig/iptables
Depending on how your firewall is configured, you may or may not see a specific rule allowing incoming packets on port 22. You can add a rule to allow ssh using the iptables command or if you're uncomfortable with the command line you can using the firewall GUI in Redhat. On 8.0 there is actually a little checkbox you can click to allow ssh.
HTH
 
Old 06-27-2003, 07:31 PM   #3
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
so, does it secure if i do ssh to my linux bx? will there be any eavesdropping happens in this case? do i need to do some sort of security procedure to get rid of the incident to happen?
thanks
 
Old 06-27-2003, 10:34 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
SSH is a pretty secure protocol. Anyone sniffing packets would just see un-readable encypted characters. If you want to know more about the SSH crypto usage, just look at the ssh man page.

One thing I would recommend would be to edit the /etc/ssh/sshd_config file and disable root logins (change PermitRootLogin yes) to "no". That makes it a bit harder to crack the root password. Then login as a normal user and use su - to become root.

Just a question for you, were you able to login by SSH before?

Last edited by Capt_Caveman; 06-27-2003 at 10:35 PM.
 
Old 06-28-2003, 12:52 AM   #5
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
thanks for guidance capt_caveman. nope.... i am still NOT able to login. last time, when i was in the same LAN. i was able to login.
hmm.... how should i login then??? now, i want to login from internet...as ur information, my linux box is my main gateway, there are two NIC, one is for private (local network) and one is for public (internet). the linux box is connected to an adsl line....and that is 24 hrs online.....i never shut it down. so, i am ssh to the public NIC from internet. do i make a correct step? i tried both sshd and netstat are ok.....

Last edited by yenonn; 06-28-2003 at 12:53 AM.
 
Old 06-28-2003, 07:00 AM   #6
koningshoed
Member
 
Registered: May 2002
Location: South Africa
Distribution: Gentoo
Posts: 103

Rep: Reputation: 15
try running (you must be root)

hping server_addr --traceroute -p 22 -S

This will perform a traceroute, except that it'll use TCP SYN packets with incremental ttl values (starting at 1). This will show you the path that your packets follow, and if your packets never reaches the server, you will simply stop seeing anything at some point. (Unless you get connection refused, in which case you will see RST packets, if you reach the host and it accepts your connections you will see SYN/ACK packets, "flags=SA").

If this succeeds, you need to configure sshd to actaully allow connections from anywhere (man sshd_config)
 
  


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
E stuffs boolim Slackware 1 05-09-2004 02:16 PM
Networking stuffs absolut Mandriva 2 01-30-2004 10:25 AM
MIDI stuffs. dtheorem Linux - Software 1 09-23-2003 11:41 AM
What are your preferences on stuffs like.... chingasman Linux - General 3 02-01-2003 02:55 PM
Linux Stuffs chingasman Linux - Software 1 12-19-2002 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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