Home > linux > MaxStartups and MaxSessions configurations parameter for ssh connections?

MaxStartups and MaxSessions configurations parameter for ssh connections?

June 11Hits:29
Advertisement

I am copying the files from machineB and machineC into machineA as I am running my below shell script on machineA.

If the files is not there in machineB then it should be there in machineC for sure so I will try copying the files from machineB first, if it is not there in machineB then I will try copying the same files from machineC.

I am copying the files in parallel using GNU Parallel library and it is working fine. Currently I am copying 10 files in parallel.

Below is my shell script which I have -

#!/bin/bash  export PRIMARY=/test01/primary export SECONDARY=/test02/secondary readonly FILERS_LOCATION=(machineB machineC) export FILERS_LOCATION_1=${FILERS_LOCATION[0]} export FILERS_LOCATION_2=${FILERS_LOCATION[1]} PRIMARY_PARTITION=(550 274 2 546 278) # this will have more file numbers SECONDARY_PARTITION=(1643 1103 1372 1096 1369 1568) # this will have more file numbers  export dir3=/testing/snapshot/20140103  find "$PRIMARY" -mindepth 1 -delete find "$SECONDARY" -mindepth 1 -delete  do_Copy() {   el=$1   PRIMSEC=$2   scp [email protected]$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMSEC/. || scp [email protected]$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMSEC/. } export -f do_Copy  parallel --retries 10 -j 10 do_Copy {} $PRIMARY ::: "${PRIMARY_PARTITION[@]}" & parallel --retries 10 -j 10 do_Copy {} $SECONDARY ::: "${SECONDARY_PARTITION[@]}" & wait      echo "All files copied." 

Problem Statement:-

With the above script at some point I am getting this exception -

ssh_exchange_identification: Connection closed by remote host ssh_exchange_identification: Connection closed by remote host ssh_exchange_identification: Connection closed by remote host 

And I guess the error is typically caused by too many ssh/scp starting at the same time. That leads me to believe /etc/ssh/sshd_config:MaxStartups and MaxSessions is set too low.

But my question is on which server it is pretty low? machineB and machineC or machineA? And on what machines I need to increase the number?

On machineA this is what I can find -

[email protected]:/home/david# grep MaxStartups /etc/ssh/sshd_config #MaxStartups 10:30:60  [email protected]:/home/david# grep MaxSessions /etc/ssh/sshd_config 

And on machineB and machineC this is what I can find -

[[email protected] ~]$ grep MaxStartups /etc/ssh/sshd_config #MaxStartups 10  [[email protected] ~]$ grep MaxSessions /etc/ssh/sshd_config #MaxSessions 10 

Answers

i do not think load of 10 parallel connection is high for ssh. i assume you have passwordless access, check if there is a key issue

for i in `echo MachineA MachineB MachineC`
   do
    echo testing $i
    ssh -v $i exit
  done

Check /etc/hosts.deny and /etc/hosts.allow on MachineB and MachineC & see if connection from MachineA are allowed

Related Articles

  • MaxStartups and MaxSessions configurations parameter for ssh connections?June 11

    I am copying the files from machineB and machineC into machineA as I am running my below shell script on machineA. If the files is not there in machineB then it should be there in machineC for sure so I will try copying the files from machineB first,

  • How can I configure a reverse SSH connection to the connecting computer?August 1

    I'm going to be deploying a number of machines in the near future which will be behind routers. It won't be feasible to set up dynamic DNS on each router and port forwarding, so is there a way I can configure these machines to initiate a TCP connecti

  • Know of a trick to sustain quiet ssh connections from firewall auto-disconnects?

    Know of a trick to sustain quiet ssh connections from firewall auto-disconnects?April 27

    Our enterprise firewall is configured to disconnect ssh connections after 30 minutes of of inactivity. Sometimes, I need to perform an operation on a server that requires a sustained connection exceeding this period, but which my shell appears inacti

  • How to configure a shortcut for an SSH connection through a SSH tunnelAugust 1

    My company production servers (FOO, BAR...) are located behind two gateway servers (A, B). In order to connect to server FOO, I have to open a ssh connection with server A or B with my username JOHNDOE, then from A (or B) I can access any production

  • How do I configure a new Ubuntu installation to accept ssh connections?July 5

    I just installed Ubuntu 11.04 (in a VM). How do I set it up to allow me to ssh into it? (Right now I get "ssh: connect to host x.x.x.x port 22: Operation timed out".) --------------Solutions------------- sudo apt-get update sudo apt-get install

  • Configure OpenSSH server and router to accept SSH connection over internet?July 7

    I want to access my PC from anywhere. I'm able to connect to the PC within the same LAN using the local IP. However, outside the local network I see a connection time out error. How can I configure my OpenSSH server on Host and my router to allow SSH

  • SSH connections not accepted after configuring NFS?April 18

    I have a couple of servers in a VPC in Amazon EC2. One of them acts as a NFS server, and one of them as a client. I recently noticed a problem in the client that after a reboot, it would reject all SSH connections, presumably because SSH was not runn

  • How to get the ip address of VM and use it to configure SSH connection dynamically in AnsibleJanuary 28

    I am trying to get the IP address of a VM and then trying to use it to establish SSH to that VM. Following is the script: --- - hosts: localhost become: yes connection: local gather_facts: false serial: 1 vars_files: - createVmVars.yml tasks: - name:

  • ssh connection closed immediately after successful loginJuly 11

    I am running Fedora 18 and just set up a static IP address. With a dynamic IP address I was able to successfully use ssh, now however I get the message: Last login: Thu Jul 11 12:56:39 2013 from quest.it.northwestern.edu Connection to mahavira closed

  • SSH connection reset on CentOSMay 4

    my SSH connection disconnect each time someone else is accessing the server from remote with SSH. if I would like to connect again I'll need to the verify the SSH key all over again and the other remote connection will disconnect. any idea what causi

  • Can't share an ssh connection with rsync

    Can't share an ssh connection with rsyncSeptember 19

    In my .ssh/config file I have the following: Host xxx User yyy HostName zzzz ControlMaster auto ControlPath ~/.ssh/%[email protected]%h:%p This works great for multiplexing my ssh connections (i.e. login once, and share the connection with multiple sessions). I wou

  • ssh: connect to host port 22: Connection refused with external ip addressJune 9

    ssh: connect to host XXX.XXX.XXX.XX port 22: Connection refused This happens when i try to connect with external ip (WAN IP Address). I am successfully able to connect using internal ip address under lan. What is going wrong why am I not able to conn

  • Keeping ssh connections open on Windows?August 16

    I know that on Unix Systems, you can keep an ssh connection open. Step 1: Create a ssh configuration, for example: Host <some.host.name> ControlPath ~/.ssh/master-%[email protected]%h:%p ControlPersist yes Step 2: Start ssh with the -M parameter. Is there somethin

  • SSH connecting issueSeptember 10

    So I got a VPS and I am trying to SSH into it but I keep getting this denied error Permission denied (publickey,password). Here is my config file. # Package generated configuration file # See the sshd_config(5) manpage for details # What ports, IPs a

  • On ssh connection the auth.log shows as source IP the external IP of the server instead of the IP of the clientJanuary 29

    I have a very odd situation with my ssh connection. Every time I connect to my server, whatever is my external ip, the connection have as source the server's external ip. Example Server S.O.: PCLinuxOS Client ip: [C.C.C.C] Server ip: [S.S.S.S] After

  • ssh connection fails after login at one userMarch 23

    Have server with 2 users - (e.g. - user and root). SSH login to root works corrctly. But I can't login to user - it immediatelly fails with "write failed - broken pipe" after login. ssh -vvv [email protected] OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e

  • Why ssh connection is refused?April 26

    How can I set up ssh connection success for all times? I do remote communication to my Raspberry Pi using ssh. Most of the time I can connect. But sometimes, I got connection error as "session is down". Sometimes, "connection is refused&quo

  • SSH connection timing out on certain clients onlyJuly 21

    I have a server that has around 100 SSH tunnel connections active from client servers across Canada and the US. We use the same device that runs a custom build of Ubuntu and load that on each client server that connects to the server. Recently, I hav

  • Public Key authentication fails while using the -i parameter on ssh commandAugust 12

    I have to do public key based authentication on two Linux servers. Machine 2 (192.168.3.132) username: vfx_30 home dir: /home/vfx_30 ssh keys: /home/vfx_30/.ssh/id_rsa /home/vfx_30/.ssh/id_rsa.pub Machine 1 (192.168.3.131) vfx_30 user's public key fi

  • ssh connections to Ubuntu are intermittentNovember 30

    I'm trying to use ssh to connect from a Mac to Ubuntu 12.04. I get "Connection reset by peer." Try again and I get "port 22: Connection refused." Keep trying and I get password prompt. Enter password and login successfully. Do a couple

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.717 s.