LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2006, 12:11 AM   #1
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Rep: Reputation: 15
Super Newbie trying to see if SSH is running or not.


Like I say in all my threads, I am a Linux Super Newbie. I have just installed Linux not to long ago and of course command line is very awkward for me. So far I found the Linux community to be very helpful, even when it must be like pulling teeth to help me. Thanks to everyone that has contributed to my Linux education!

My latest adventure is to run the SSH daemon (I think that is what you guys call it) and try to login to my Linux machine from an outside network. I do have a firewall router in the middle of all of this.

I have given it a good shot at trying to set this up, but I just can’t log in. There are probably several dumb reasons why I can’t. Here is where I am at (well here is Part I):

The first thing I did was go into the directory /etc/ssh and made a copy of the file “sshd_config”. I named that file sshd_config-backup and left it in the same directory.

I edited the “sshd_config” file to have “Port 504” (I heard it was more secure to keep it away from 22). I also edited the “PermitRootLogin yes” to “PermitRootLogin no”. I saved that file in the same ssh directory.

Here is the first weird thing: I opened a terminal window and I typed: “/etc/init.d/ssh start” and it spat out “Start OpenBSD Secure Shell server: sshd”. So I take that as “yes – it’s running”. Then I typed “ps –ef | grep sshd” to see it is running and I noticed that all the time durations are 00:00:00. I am guessing that this means nothing is running. But I don’t really know because I am just a newbie…

Can anyone tell me if this was the right way to check if it was running or not? And if it is not running, what should I do to get it to start running?
 
Old 08-17-2006, 01:05 AM   #2
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon, Debian
Posts: 278

Rep: Reputation: Disabled
/etc/init.d/sshd status

Usage: /etc/init.d/sshd {start|stop|status|try-restart|restart|force-reload|reload|probe}
 
Old 08-17-2006, 01:20 AM   #3
jp-lack
Member
 
Registered: Mar 2005
Location: NJ - US
Distribution: Slackware
Posts: 93

Rep: Reputation: 15
you can also try

#ps aux | grep ssh

you should see a line ending in /usr/sbin/sshd

or

you can also check if the port is open.

#nmap localhost -p 504
 
Old 08-17-2006, 01:40 AM   #4
BrianHenderson
Member
 
Registered: Aug 2004
Location: Oregon, USA
Distribution: Ubuntu 6.06; Debian Testing
Posts: 40

Rep: Reputation: 15
I'm pretty sure the "time durations" count the amount of processor usage, not the time since you started the program.

From the machine you are trying to run sshd on, run (as your normal user):
Code:
ssh -p 504 localhost
If this command gets you to a password prompt, it's running.
 
Old 08-17-2006, 08:29 PM   #5
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
so when I type ps aux | grep sshd i get the following results:

root 3623 0.0 0.3 2992 932 ? Ss Aug16 0:00 /usr/bin/ssh-agent /usr/bin/startkde
root 3824 0.0 0.6 3476 1536 ? Ss Aug16 0:00 /usr/sbin/sshd
root 5537 0.0 0.2 3600 580 pts/1 S+ 16:59 0:00 grep ssh


so what does that mean....?
 
Old 08-17-2006, 08:42 PM   #6
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
ok I logged into my machine as a guest and then I tried this which is leading me to think that it is working:

guest@1[~]$ ssh -p 504 localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is ec:6e:0c:17:12:70:66:93:db:6c:d5:02:57:e3:79:be.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
MEPIS 3.3

Most of the programs included with MEPIS Linux are freely
redistributable; the exact distribution terms for each program
are described in the individual files in /usr/share/doc/*/copyright

MEPIS Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.

/usr/bin/X11/xauth: creating new authority file /home/guest/.Xauthority
guest@2[~]$ ls -l
total 48
drwxr-xr-x 3 guest users 4096 2006-08-02 20:49 Desktop
drwxr-xr-x 2 guest users 4096 2004-08-18 20:54 Documents
drwxr-xr-x 8 guest users 4096 2003-08-26 20:57 Mail
drwxr-xr-x 2 guest users 4096 2004-03-14 10:44 Music
-rw------- 1 guest users 1102 2004-05-27 18:36 mycheckbook
-rw-r--r-- 1 guest users 1102 2004-05-27 18:36 mycheckbook.backup
drwxr-xr-x 3 guest users 4096 2004-05-24 13:24 News
drwxr-xr-x 2 guest users 4096 2004-03-12 15:33 Pictures
drwxr-xr-x 2 guest users 4096 2003-01-28 18:51 public_html
drwxrwxrwx 2 guest users 4096 2003-09-03 23:06 Shared
drwxr-xr-x 2 guest users 4096 2004-05-22 15:22 smb4k
drwxr-xr-x 2 guest users 4096 2002-12-10 15:34 tmp
guest@2[~]$ logout
Connection to localhost closed.
guest@1[~]$
 
Old 08-17-2006, 08:44 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
so what does that mean....?
That means that you have an ssh-daemon running (sshd), an ssh user agent
running (/usr/bin/ssh-agent /usr/bin/startkde) and that you're grepping
for ssh (grep ssh).


Cheers,
Tink
 
Old 08-17-2006, 08:50 PM   #8
BrianHenderson
Member
 
Registered: Aug 2004
Location: Oregon, USA
Distribution: Ubuntu 6.06; Debian Testing
Posts: 40

Rep: Reputation: 15
First of all, the middle row is your sshd server running.

Running ps aux by itself has a header which tells you what each column is. Looking at the man page will probably get you more info:

Code:
man ps
If you want to know more about any command, look at the man page ("manual page") with the command man <command>
 
Old 08-17-2006, 09:23 PM   #9
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
Ok the second part of this adventure is for me to try to login to the Linux machine from my windows machine using SSH. Now both the Linux machine and the PC are connected to the same router. The router/firewall is connected to my DSL modem.

I installed this SSH program for my PC called PenguiNet. I haven't been able to login remotely to the Linux machine using this program. I have tried many different combinations of inputs here. I am not quite sure what I am doing though. Below I have listed the possible inputs for connecting using this SSH program (after my questions). Most of them seem pretty obvious.

My Questions:

1. For the Host input. Do I put my router's IP address or the Linux Machine's IP address? Or the Linux Machine's IP address when it's not on a router (it's true IP address)?
2. For the Port input. I have picked 504 to be my port of choice, but do I put in 22 here, or 504?
3. UTF8. Don't know what that is for. Keep it unchecked?
4. Username and password: I have set my ssh config file to not let people remotely login as root. So do I use my Linux machine's guest login name and password? Or do I have to set this up somehow?
5. SSH Authorisation. Password or Key Pair? Do I need both SSH1 and SSH2 Key pairs?
6. Finally the port forwarding. I don't know what to put for "From Port", "Forwarded Port" or "Forwarded to host"...

LOGIN TAB:
Profile name: (looks like something optional, where I can give it a name)
Host:
Protocol: (SSH, Telnet or SCP)
Port:
Terminal Type: (Linux, VT100, xTerm)
UTF8 (this is just a checkbox that is currently not checked)
Username:
Password:

SSH TAB:

SSH Version: (Automatic, FORCE SSH1, FORCE SSH2)
Compression: (Ranges from Level 0 which is no compression, to Level 9 which is maximum, it's currently set to 6 which is the default)
Authorisation via: (Password - default, Public/Private Key Pair)
SSH1 Key Pair:
SSH 2 Key Pair:

PORT FORWARDING BUTTON:

From Port:
Forwarded Port:
Forwarded to Host: (currently says localhost)
Protocal: (Normal, FTP)
 
Old 08-17-2006, 10:10 PM   #10
BrianHenderson
Member
 
Registered: Aug 2004
Location: Oregon, USA
Distribution: Ubuntu 6.06; Debian Testing
Posts: 40

Rep: Reputation: 15
Assuming both are on the lan side of the router:

1. The Linux machine's IP address
2. 504 - the server is running on 504, not the normal 22
3. it's a character encoding, leave alone unless there is messed up text
4. use a normal/guest user account and password
5. password, you have not set up key authentication
6. no forwarding
 
Old 08-18-2006, 01:27 AM   #11
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
I am not getting a connection...The IP address I am trying is 192.168.1.3, is this correct?
 
Old 08-18-2006, 01:54 AM   #12
BrianHenderson
Member
 
Registered: Aug 2004
Location: Oregon, USA
Distribution: Ubuntu 6.06; Debian Testing
Posts: 40

Rep: Reputation: 15
Is that the address you get if you run ifconfig on the Linux machine? (Look at eth0's address)
 
Old 08-18-2006, 02:05 AM   #13
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
yeah. The only thing I can think of is that it might be my ssh config file..
 
Old 08-18-2006, 02:41 AM   #14
lloydshanks
LQ Newbie
 
Registered: Aug 2006
Distribution: Mephis
Posts: 26

Original Poster
Rep: Reputation: 15
This is a question that is bothering me....

Everytime I change something in my ssh config file, do I need to stop and re-start the ssh server?
 
Old 08-18-2006, 02:49 AM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
yes



Cheers,
Tink
 
  


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
Super newbie - where to start? cypheruk Linux - Newbie 9 01-31-2006 09:16 PM
please help a super newbie with RH9 yarzy Linux - Newbie 12 01-29-2006 03:21 PM
Super Newbie Good2Go Linux - Newbie 6 01-24-2006 05:51 PM
super newbie needs help ! kinghimself Linux - Software 5 11-09-2003 11:28 AM
super newbie a45b22chp Linux - Newbie 11 05-04-2003 05:46 PM


All times are GMT -5. The time now is 06:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration