New answers tagged

0

The order of config-statements counts ... my solution to the file /etc/ssh/sshd_config: Match User <username> PasswordAuthentication yes Match User all PasswordAuthentication no


3

You are not being asked for the password for the remote host. You are being asked for the passphrase for the ssh key you created. To fix the problem, supply the passphrase. If you did not want a passphrase on your key, then you should no longer set one when you create the key. You can also remove it by setting an empty passphrase.


-1

check to see if the file exists on the nodes: ssh user@node1 ls -la ~user/.ssh


-1

By just copying the controller SSH key via the ssh-copy-id command to the 3 server nodes you allow access FROM the nodes TO the server. You have to do the same in reverse (ie. ssh-copy-id from each node TO the server) to allow access from the controller to the nodes.


0

I also had this issue. I found out that the destination host had the wrong netmask set on the interface (it was using /24 instead of /16). Once I fixed this and rebooted, I could connect immediately.


0

I had disabled agent forwarding for all hosts, thinking I could enable it for each specific host where I need it. Apparently that doesn't work. Host * ForwardAgent no Host myserver HostName myserver.example.nl ForwardAgent yes The solution was to remove the ForwardAgent no from the Host * block.


0

Apparently, this is an encoding issue. By default, Get-Content returns file content as an encoded string but tar expects binary stream. The solution would be to encode the binary data to a text format like Base64 and decode it. I come up to the following one-liner by its terrible slow. [System.Convert]::ToBase64String((Get-Content -AsByteStream file.tar)) | ...


1

You don't need a "hacked" sshd. You should be able to run sshd -ddd to put it into debug mode. For example... /usr/sbin/sshd -ddd -p 2222 ...would listen on 2222 if you can direct client traffic to that port. If not, stop the system sshd and start a debug listener to test the client with. With any luck, the server-side debug will help you ...


0

In my case, removing the line IdentitiesOnly=yes from my ~/.ssh/config file solved the issue.


0

You can set variables on any task, block, or play using the vars keyword. - name: Wait for SSH to come up delegate_to: "{{ ec2.instances[0].public_dns_name }}" wait_for_connection: delay: 60 sleep: 15 timeout: 40 vars: ansible_user: centos


0

ssh-copy-id cannot install public keys to a user provided file. .ssh/authorized_keys (or /etc/dropbear/authorized_keys for a dropbear server). You could contribute an option to allow the user to provide this, but will be some time before such a patch is accepted upstream and downstream. When the user has a complete authorized_keys locally, they can upload ...


0

these all codes working if i run by direct in terminal So if you're not running in your terminal, then how is it being run? If it's being run under some other user, then that user may well not have access to that directory (or one or more of its parent directories). Examine the permissions on each directory in the path /home/domain.com/data.


0

I have no reputation to comment, so I write it as an answer. Have you tried the cd command using relative path instead? If I am not wrong this would be: cd ../domain-statistics


2

Use tcp traceroute Following Tero Kilkanen's advice, I installed tcptraceroute, which led to resolution of the problem. Edit: I wanted to add that I hadn't used traceroute because I knew it used ICMP protocol and wouldn't be necessarily be routed the same way as my TCP SSH packets. So tcptraceroute was new to me and I think it's going to be very useful! ...


1

The correct answer for me were both the answers of Jakuje and noraj combind: You need to specify the remote bind address in addition to the remote port to -R (i.e. -R '*:$REMOTEPORT:$LOCALADDR:$LOCALPORT'). If you don't specify the address, sshd will only bind to the loopback interface (by default). By default, it seems, /etc/sshd_confing's GatewayPorts [...


3

After some hours of work, i solved it You need to create a customized policy inside the directory /etc/crypto-policies/policies/modules/, setting the rules to disable CBC ciphers Example vim /etc/crypto-policies/policies/modules/NO-CBC.pmod In this file, you should put all the ciphers you want to disable, like this: tls_cipher = -AES-256-CBC -AES-128-CBC ...


0

If the connection stalls before port forwarding is set up, we can leverage a socket as a semaphore and hack together our own watchdog: lfg.sh: #!/bin/bash set -m function watchdog { sleep $1 if [[ ! -S "/tmp/lfg.$2" ]]; then kill -STOP $3 fi } ssh -L /tmp/lfg.$$:localhost:1234 $1 && rm -f /tmp/lfg.$$ & watchdog $2 $...


1

(From comments plus update) The problem is that the target device is really lame and apparently (as diagnosed by ssh) supports only old and mostly obsolete SSH options that recent OpenSSH dislikes. First, it has only a DSA (also spelled DSS in SSH) key. ssh-keyscan by default has never requested a DSA key, although the set of types it does request has varied ...


0

This seems to be a known issue since 2016 with no official solution: https://bugzilla.mindrot.org/show_bug.cgi?id=2621


0

If the underlying connection is stable and our main goal is to open multiple sessions without playing PAM roulette, "master" mode may help: ssh -M -S /tmp/reusable.sock user@host Once you win the Ctrl+C/90-second timeout fight the first time, other terminals may be opened rapidly with: ssh -S /tmp/reusable.sock user@host This works as long as the ...


0

following this steps helped me install ssh on the container enable the service with /etc/init.d/ssh start run echo 'root:a-strong-password' | chpasswd to set password for root edit /etc/ssh/sshd_config and set PermitRootLogin yes then /etc/init.d/ssh restart then ssh -fNTCR localhost:<YOUR-PORT>:localhost:22 remote-host this goes to background and ...


-1

KeepAlive yes ClientAliveInterval 90000 ClientAliveCountMax 2 These three lines indicate that if within 90000*2 seconds there is no TCP package from the client, it will cut the connection automatically. This is a protection mechanism by SSH. Either you change the parameter or use Bitvise ssh Client instead, which would automatically send TCP Ping-Pong ...


1

I've stuck with the same problem and I've worked around with this configuration: The key was setting Guest IP as 0.0.0.0 HTH


0

For the benefit of others who made a silly mistake like I did (one that isn't mentioned in other answers): Make sure your remote machine actually has a process listening on the port that you're trying to tunnel to! As @Kenster says here: When you connect to port 8783 on your local system, that connection is tunneled through your ssh link to the ssh server ...


0

Generally, systemctl restart networking (Debian/Ubuntu), systemctl restart network (CentOS) should work, without a tmux/screen session.


1

Ask the administrator of that remote server to enable public key authentication for you. Because public key authentication needs to be supported both server side and from the client, you can't force it from the client alone. For scripted access sshpass is a possible solution. That allows you to store your password in a file to automate logging in when you ...


3

The matching is done on Host stanza, not on HostName. Try: ssh ubuntu@remote


2

scp -P <port> <local file> root@<ip>:<dir> Try with a capital "-P" for the port flag.


3

Basicaly requirements are: ServerB needs to be only reachable from ServerA. You don't connect to it directly. ServerA needs to have TCP Tunneling enabled. ServerA needs to be reachable from you. You set up connection to ServerB through a jumphost (in .ssh/config): Host ServerB ProxyJump ServerA This assumes that if you enter ssh ServerA, you'll end up ...


3

The difference between your command line ssh -J ubuntu@54.170.186.144 ubuntu@10.240.0.20 and what I recommend you do to reference your configuration ssh remote is that the latter has neither IPs nor the user to login to on both machines in the command line - you have to edit your ssh configuration to include all the information you are no longer passing on ...


3

Sometimes people setup rate limiting using iptables. The OpenSSH has the MaxStartups option that does some rate limiting on incoming clients. The default (at least on my computer) is 10:30:100. man sshd_config Alternatively, random early drop can be enabled by specifying the three colon separated values start:rate:full (e.g. "10:30:60"). sshd(8) ...


1

You can have machineA to open an SSH tunnel to machineB, with a remote forward option, which would allow you to SSH into machineA from machineB. If you have root access on machineB, then set the GatewayPorts configuration option to yes in /etc/ssh/sshd_config, then issue this command on machineA: ssh -N -R 0.0.0.0:2222:127.0.0.1:22 the_public_ip_of_machine_B ...


1

I resolved my issue with 'kex_exchange_identification: Connection closed by remote host' when I noticed I was trying to connect using the Server IP when I should have been using the Private IP. My set up may be worlds apart from all of you, just thought to pass on my own discovery. EDIT: With some hosting providers you will have two IPs, one is public, one ...


0

I had this same issue on Mac OSX. Most of my ssh/scp session wouldn't work, especially with large files. Turns out I had set my network interface manually and it didn't like it. I changed it back to Automatic configuration and everything started working again. System preferences > Network > Ethernet > Advanced > Hardware > Configure: set ...


0

All the above are great and work and if I may be allowed to tie it up a little. I use a standard sshd_config across a large number of servers and flavours making the configuration a deliberate thought processes and this is what I use. My use case: Root access is restricted to key only from 2 specific IP's Automation users (eg ansible) are restricted to key ...


1

My approach would be to setup a PPP server on the Linux side on the serial port, and then configure Windows as a PPP client over the serial link. That way you will get standard IP networking between the two machines.


1

According to sshd_config man page (OpenSSH_8.0p1): For each keyword, the first obtained value will be used. So I guess the first example looks like the correct one. Please note: I have strong feeling this changed recently (from the LAST value to be used) so please check your man pages. And (as I just checked it) it doesn't look like it is working as ...


Top 50 recent answers are included