Centos SSH access denied [closed] - ssh

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm pulling my hair out over this and can't find a solution anywhere.
After a reboot I started getting "Connection refused" through port 22000 which was the one I had configured and SSH was still listening to(I double checked). I'm connecting from a PC on the same LAN.
I could connect to port 22 suddenly after that but there I got "Access denied" after entering my password. After troubleshooting this I got tired and reinstalled openssh, with that I got a clean config and everything including the firewall and selinux is now configured to use port 22 with these commands:
sudo semanage port -a -t ssh_port_t -p tcp 22
sudo firewall-cmd --permanent --zone=public --add-port=22/tcp
sudo firewall-cmd --reload
Still access denied even though it's the correct password, I know since I can use the exact same directly on the server.
I have tried:
Putting "PermitRootLogin yes" in the sshd_config and login with root but that is also denied, same with a new test account I made. I removed "AllowUsers [username]" from the config before this.
Restarted the SSH service and rebooted as well several times.
The solution here to no avail: Centos 7 Remote SSH access denied
Setting selinux to "Permissive"
Disabling the firewall
Changing password to one without special characters
Triple checking that the SSH service is running
Neither "/var/log/secure" nor "/var/log/messages" log anything regarding my attempts to login.
I must have missed something, anyone have any ideas what?

use: ssh -vvv username#host to check the issue.
Try creating a pem file and see if it works.

I solved it and I really don't want to post the answer since it was embarrassingly easy, but I refuse to leave the question unsolved for the poor souls with similar problems.
I rebooted my PC.... facedesk

Related

SSHing to raspberry pi returns "middle man attack" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am trying to SSH to my raspberry pi which is connected under the same router as my computer. It is running the latest version of raspbian lite. I enabled the ssh service on the pi using the command: systemctl enable ssh. However when I try to SSH to my raspberrypi from my personal computer, I get this message:
fahd#Fahd-PC:~$ ssh pi#192.168.1.23
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:***************************************************
Please contact your system administrator.
Add correct host key in /home/fahd/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/fahd/.ssh/known_hosts:1
remove with:
ssh-keygen -f "/home/fahd/.ssh/known_hosts" -R "192.168.1.23"
ECDSA host key for 192.168.1.23 has changed and you have requested strict checking.
Host key verification failed.
fahd#Fahd-PC:~$
And I'm not entirely sure whether this is something real I should be worried about or just me not knowing how to use SSH properly.
For some reason, your terminal has a different key in storage for your Pi. This can be due to several reasons (for example, the ssh package was updated and the SSH host key re-generated on the Pi. Or you changed the IPs on your network. Or you have DHCP and two different clients, and you got the addresses swapped. Or...).
So, it warns you.
Unless you have reasons to believe otherwise, I'd just follow the suggestion:
remove with:
ssh-keygen -f "/home/fahd/.ssh/known_hosts" -R "192.168.1.23"
This communicates inform you that RSA keys on the device has changed it happen when you:
reinstall OS on device
generate new / remove old RSA keys
someone is trying to do MITM attack (very rare in these days)
How to fix it:
Remove saved information about raspberry pi host
sudo vim ~/.ssh/known_hosts
or
sudo vim /etc/ssh/known_hosts
Use ssh-keygen
ssh-keygen -R host_ip
or
ssh-keygen -R host_ip -f path_to_known_hosts
Remove known_hosts
If you have only one host in "known_hosts" file you can just remove it.
sudo rm .ssh/known_hosts

XAMPP 5.5.28 doesn't work on OS X 10.11 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My iMac' OS was upgraded last night, to OS X El Capitan(version 10.11).
I use XAMPP 5.5.28. MySQL and ProFTPD are working, but the Apache Web Server doesn't work after the upgrade.
Even though the application log says..
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
Then tried to start it on Terminal
$ sudo /Applications/XAMPP/xamppfiles/bin/httpd
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
I checked whether any other app uses the same port by
$ netstat -anp tcp | grep :80
And nothing uses it.
Anyway, to avoid the error, I changed the port 80 to 8888 by
$ vi /Applications/XAMPP/etc/httpd.conf
Then tried to start the web server on Terminal again, and it worked.
Now wondering
Which process uses port 80?
How can I start the web server via Application Manager of XAMPP?
Any help is appreciated.
I had the same problem
And I thought this is a dead end for El Capitan
BUT i got it working now:
The problem was apache was already running, no idea how.
So just go to terminal and type (Login as root user)
sudo su -
cd /etc/apache2/
apachectl stop
exit
Then go to XAMPP and try to start apache from there.
If this doesn't work, restart your system, then go to terminal:
sudo su -
cd /etc/apache2/
apachectl start
apachectl stop
exit
Then go to XAMPP and try to start apache from there.

Apache Cannot bind to port 80 [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 months ago.
Improve this question
I'm trying to use Bitnami MAPP Stack 5.5.30-0
(For Apache Web Server, PostgreSQL)
When I try to configure the Apache Web Server I get this error: "Cannot bind to port 80. It is probably taken by another application or you don't have enough privileges.
I don't want to change and use another port. I really want to use the port 80.
I don't know what app is using the port 80.
I am running MAC OS X Yosemite
I tried this command:
sudo lsof -i ':80'
But nothing is running on this port.
I opened the httpd.conf and I tried to change the listen port to 80. But still not working.
Can someone help me?
Thank you
Maybe you already have Apache or Nginx running but you need to stop both of them before starting Apache with XAMPP. You can do this with:
To stop Apache: sudo /etc/init.d/apache2 stop
To stop Nginx: sudo nginx -s stop
This means that you either have another process that is already using port 80 or you don't have enough privileges. The following unix command might shed some light. You can run it in terminal:
sudo lsof -i ':80'
Check out this link as well.
If it turns out that you don't have enough privileges, try to configure / run apache using sudo. (sudo stands for superuser do). Note: this maybe a quick fix to get you going on your local machine, but it is not recommended on a production machine.

rsync through ssh tunnel [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I want to rsync to a cluster node to which I usually connect passing through another system:
Say I connect first to
ssh user#bridge
and from there to
ssh user#clusternode
Now I want to rsync from my workstation to clusternode. I do the following:
I open a ssh tunnel
ssh -L8000:clusternode:8000 user#bridge
I rsync from my workstation to clusternode
rsync -e "ssh -p8000" source user#localhost:destination
and it does not work, I get
ssh_exchange_identification: Connection closed by remote host
Why does it not work? What do I have to do?
I have found a lot of information here:
http://toddharris.net/blog/2005/10/23/rsyncing-through-an-ssh-tunnel/
I think to understand that my problem is the second authentication between the bridge and the destination, so I changed to method 2 that is also not very elegant, but it works. I would like to try method 3, but I don't know how to configure a rsync daemon
Try this one-liner:
rsync -av -e "ssh -A root#proxy ssh" ./src root#target:/dst
Here's what worked for me.
I run a command in the background to tunnel to the remote host:
ssh -N -L 2222:remote.example.com:22 bridge.example.com&
then I rsync to localhost like this:
rsync -auve "ssh -p 2222" . me#localhost:/some/path
You should connect to the port 22 of clusternode, so the tunnel should look like
ssh -L localhost:8000:clusternode:22 user#bridge

SSH through multiple hosts to execute another ssh session [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I spent to much time trying to do something which in plain words looks simple
I am at home, without firewall and all open ports. I need to ssh to the router at work where I have access to ssh port 22. My personal machine is on that subnet having internal ip address. So, what I need to do is to ssh from one machine to the second and from the second to the third. On the third I need to execute another ssh which tunnels some ports to my home machine. All that in bash script from my home. I have tried many solutions on the internet but nothing works.
The whole ideal is to get to my PC at work and run ssh tunnel for port 22 which will allow me to sshfs my work PC.
I could do it manually, by sshing to the router, that form the router to the work pc and then execute the ssh tunnel. I need a one-click solution.
Thanks in advance!
Have you tried just stacking the ssh commands like ssh -t localhost ssh localhost be sure to add the -t option for each hop except the last one ssh -t localhost ssh -t localhost ssh localhost
Maybe try VNC? With the right setup/port forwarding, you wouldn't have to jump from 1 PC to the next.