Solved

ssh in CentOS

Posted on 2014-04-24
23
546 Views
Last Modified: 2014-05-06
Hi Experts,
I have CENTOS installed, version 6.5
How to check, if SSH is active ?
I need to SSH with a user for my inventorry software.
0
Comment
Question by:Eprs_Admin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 4
  • +5
23 Comments
 
LVL 34

Expert Comment

by:ste5an
ID: 40019448
E.g.

clear && ps aux | grep ssh

Open in new window

.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40019453
try it. login to server then run

ssh 0

This should bring you login prompt
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40019466
@omarfarid: this changes the state of the system..
0
Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

 
LVL 40

Expert Comment

by:omarfarid
ID: 40019471
How? I am not saying run

init 0

ssh 0 will run ssh to connect to local host ( 0 is local host ip address)
0
 
LVL 121
ID: 40019499
Download PuTTY and try to connect via SSH from your Windows PC ?
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40019530
Yup, it will start a ssh process. This is a state change, thus you have circumvented the question 'check, if SSH is active', cause you started it so the answer is always true.
0
 
LVL 5

Expert Comment

by:Dave Gould
ID: 40019534
Who needs to initiate the connection? You or the other end?
If its you, you dont need the sshd deamon running so the ps command in the first reply wont change much.
start by checking you have the right packages :
yum list openssh
yum list openssh-clients
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40019582
Dear ste5an,

I think the author wants to verify if sshd is running on the system or not so remote user can connect to the server.

Another way to get status os sshd on the centos server is to run

service sshd status

OR

/etc/init.d/sshd status
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40019593
Maybe.. but this is also covered by the ps-grep.

p.s.
But this is a security affected question. Thus we can expect precise questions. Just my 0.02..
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40019599
To be more accurate with the ps-grep command:

ps -ef | grep -v grep | grep sshd
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40019741
Not really, as we are just guessing whether the OP means ssh or sshd..
0
 

Author Comment

by:Eprs_Admin
ID: 40019747
the correct package is installed, I checked already.
0
 

Author Comment

by:Eprs_Admin
ID: 40019751
with this screenshot you can see, I can login.
ssh-login-to-centos.JPG
0
 

Author Comment

by:Eprs_Admin
ID: 40019753
then it scans and tries to login with another user...see pic
ssh-login-ok-but-scan-error.JPG
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40019839
@Eprs_Admin, you may have already derived from the thread, that your question is not as precise as it could be.

What do you mean by 'How to check, if SSH is active'? Do you want to use SSH to connect from a different machine to your CentOS machine (means running sshd) or do you want to connect from your CentOS machine to a different machine (means running ssh)?

What packet(s) are you referring to?

Don't post screen shots of some fancy GUI. Use the shell (terminal) to gather the necessary information.
0
 

Author Comment

by:Eprs_Admin
ID: 40019868
From the shell I can connect to the linux .
But from Spiceworks not.

Now I know when SSH ist running :-)
0
 
LVL 62

Expert Comment

by:gheist
ID: 40020020
Firewall?
0
 
LVL 5

Expert Comment

by:Dave Gould
ID: 40020146
I'm still not sure if the second screenshot is to the centos or from it but in either case, it would seem that the cennection is being made correctly but you are having authentication problems.
Does the account ssh-administrator-d13 exist on the remote machine?
Where did you get this account from? Is it in the spiceworks config?
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40020256
Well, maybe your question is better placed in the Spiceworks community..
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40020766
The screen shot itself is confirming that ssh is running on the server. It seems that this is a port scanning tool to find open ports (running), may be as security audit.

Are you using username / password to authenticate with this tool? Or are you using keys to authenticate?
0
 
LVL 30

Assisted Solution

by:serialband
serialband earned 166 total points
ID: 40021047
In centos & other Redhat based distros you should be able to run.

chkconfig --list ssh

to list whether ssh should be active or not upon startup in the various run levels.

I think I've already pointed you to the spiceworks community in your other question.  The problem seems to be with spiceworks when you try to add the server, not with ssh itself.  Have you tried manually adding your server yet?
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 167 total points
ID: 40021325
Is your firewall running?

service iptables status
service iptables stop
netstat -atn|grep 22

Open in new window

0
 
LVL 62

Accepted Solution

by:
gheist earned 167 total points
ID: 40021357
By default CentOS has ssh on and allowed through firewall.
Since you say you CAN login, but then again Spiceworks can not - can you try storing right root password in spiceworks?
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question