Sometimes, SSH stop to listen on port 22 on my dedicated server [closed] - ssh

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 10 years ago.
Improve this question
I don't know why but sometimes, on my server, i can't connect to my server with ssh on the port 22. So, in the sshd_config file, i add the line "Port 2233" after the line "port 22" which make me able to connect on this port even when the 22 doesn't answer.
Thus i'd like to know why sometimes, ssh on port 22 doesn't work, and after a while, without intervention, it's back
Thank you all.

You have rate-limiting active in your iptables. I didn't analyze them, but if you retry without those rules, it will probably work.
Like this, only 10 connections in 5 minutes:
REJECT tcp -- anywhere anywhere tcp dpt:ssh state NEW recent: UPDATE seconds: 300 hit_count: 10 name: DEFAULT side: source reject-with icmp-port-unreachable

Related

How to set vagrants host SSH port [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 3 years ago.
Improve this question
I have multiple VMs managed by vagrant in a production environment. I like to set their SSH host ports manually while I have to open every single port in iptables. Vagrant manages these port forwarding manually by default which forces me to open a range of ports which I doesn't want to.
I already tried a port forwarding but it ends up with two ports forwarded to the guest.
config.vm.network "forwarded_port", id: "a-named-ssh-forwarding", host: 54321, guest: 22
The problem is I cannot see any option in the vagrant SSH config section. Obviously I could set the guests SSH port only.
Vagrant SSH settings
Is it even possible to set the forwarded host SSH port and if yes how?
The solution is too simple.
Overriding the Default Forwarded SSH Port in Vagrant
Just rename the ID of the forwarded port to ssh.
config.vm.network "forwarded_port", id: "ssh", host: 54321, guest: 22
This in fact removes the possibility to identify the ssh forwardings to a specific VM by reading the list. But it's a low price for the enhanced system's security.

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.

Nginx wont leave! how to remove it [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 10 years ago.
Improve this question
I've run nginx once and now I cannot get rid of it. when I run apache on my server localhost still point to that welcome to nginx i dont know why. I'm on windows 7.
To kill nginx process.
If you are sure nginx is actually running, You just need to kill nginx.exe process and re-run apache.
Open Run (Window key + R) OR commend prompt (cmd.exe) and Paste below command,
taskkill /F /IM nginx.exe
To find which process is holding port 80.
Here is netstat command & output to find which process is holding port 80.
C:\> netstat -n -a -o | findstr "0.0.0.0:80"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1588
^ Here, 1588 is PID of process holding port 80.
So, below is sample command to get Process name from PID 1588.
C:\> tasklist /svc /FI "PID eq 1588"
Image Name PID Services
========================= ======== ============================================
nginx.exe 1588 N/A
So, it shows that nginx.exe is holding port 80.

Login into Clients server with theire rsa key [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 10 years ago.
Improve this question
A client gave me a rsa and ppk file so I can log into their server. Im using OSX Lion and I have all my current server connections in my id_rsa file. How do I add their key so I can login with that?
If the RSA file they gave you is stored in, say, ~/client/foo_rsa.key, you could:
$ ssh -i ~/client/foo_rsa.key username#theirhost.example.com
Storing this sort of configuration in ~/.ssh/config is also a very good idea if you want a more permanent solution.
In ~/.ssh/config, add:
host clienthost
identityfile client/foo_rsa.key
hostname theirhost.example.com
user usernameonhost
You then connect simply with:
$ ssh clienthost
and the settings from the config file control your session.
The spacing above is unimportant and included only for readabilty. Read man ssh_config for details of other things you can put in this configuration file. There's A LOT of stuff you can do, including proxying your connection through other hosts, creating encrypted tunnels (for other protocols like HTTP or SOCKS) on arbitrary ports, etc.

How can I see what I am typing in telnet? [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 11 years ago.
Improve this question
When using telnet by using the command:
telnet <host ip> <port>
I can connect but then I cannot see what I am typing.
So I try:
telnet
set localecho
open <host ip> <port>
But this time it just hangs with the message:
Connecting to <host ip>...
How can I use telnet successfully after setting localecho?
It actually isn't hanging; it's just that, for some reason, it doesn't give any feedback to show that it's connected. If you start typing, you'll see that your input shows up in the upper-left hand corner of the window, overwriting what's already there. For example:
GET / HTTP/1.1rosoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet> open example.com 80
Connecting To example.com...
You can see that I've typed GET / HTTP/1.1, overwriting Welcome to Mic.
(By the way, notice that I didn't have to type set localecho: for me local-echo was already on when I launched telnet without arguments, and I'm betting that for you it's the same.)