New answers tagged

1

As I understand it, you want to run a command locally but save the stderr output to a remote log file. Try process substitution: local_command 2> >(ssh somemachine 'cat >logfile') Here, >(...) is process substitution. It creates a file-like object from the command in the parens. So, 2> redirects stderr to that file-like object, resulting ...


1

Currently, RSA is still recommended as a gold standard (strong, wide compatibility) ed25519 is good (independent of NIST, but not compatible with old clients. Server is usually providing more different host key types, so you are targeting for compatibility. The order of priority in the client config is from the stronger to less strong, but more ...


2

Try FreeOTP, it supports both ​HOTP and ​TOTP. https://fedorahosted.org/freeotp/ https://f-droid.org/repository/browse/?fdfilter=freeotp&fdid=org.fedorahosted.freeotp


1

The client can specify the hostkey algorithm it prefers with the option HostKeyAlgorithms in ssh_config or ~/.ssh/config or on the command line. man ssh_config on your system to see the default HostKeyAlgorithms preference for your version of openssh. The server will use the first key type which is on the client's list and exists on the server. If you ...


0

Start monitoring the server's log file tail -f /var/log/auth.log Add -v to get a verbose output at the client end ssh user@computerB -v This might give you more details about the cause. if the rsa and dsa keys are missing on the server, fix them by: ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key Note: ...


0

--sport is short for --source-port --dport is short for --destination-port In your case I believe you need to use only dport.


5

My sshpass has an option -f to read from a file. So with bash process substitution you can do sshpass -f <(myscript_call_1password) ssh host


7

sshpass does not have to show the password in the ps. It might read it an environment variable: SSHPASS=12345 sshpass -e ssh user@host or from a file: sshpass -f /path/to/password_file ssh user@host


-3

Answering the original question about automation and keystroke elimination: I saw sshpass but it requires typing the sshpass command before running ssh, which is somewhat inconvenient. Based on your comment: I have a script that communicates with the 1password database, so I'm looking to integrate the script and SSH. Define an alias (for example ...


2

Rebooting the Xquartz Client-side resolved the issue. My bad for not following rule 1. of turn it off and on again


3

If you're using password authentication, then SSH sends the password over the network. The connection is encrypted, so eavesdroppers can't see the password. The connection is authenticated, provided that you don't click blindly through a “The authenticity of … can't be established” message, so your password won't be sent to anyone except the legitimate ...


3

The ssh-agent and recent versions of OpenSSH make it simple: Start normal ssh-agent with default timeout for the keys added (60 minutes for example): eval `ssh-agent -t 60m` Configure your ssh to add actually used keys to the agent. Add a new line to ~/.ssh/config`: AddKeysToAgent yes This feature is in latest OpenSSH 7.2. In the previous versions, ...


0

The modem I have is a SmartRG SR505N I did do a bunch of netstat and looking around, and eventually did find that even though the router says it moved it's own ssh port 22 to 2222 after I enabled port forwarding to my lan side server, it doesn't actually move it's own ssh server, but it's weird, sometimes it would work, other times it wouldn't. I read about ...


0

SSH does send the userid and password over the network in plain text inside an encrypted channel. This is why when you connect a new host you get prompted to accept the key. In the case of a man-in-the-middle attack with a known host, SSH will refuse to connect until you remove the old key. The plain text password is available at the end points, your ...


3

If you use a password based authentication scheme then, yes the password is passed over the network to the end point... But it is an encrypted channel. eg % ssh remotehost user@remotehost's password: bash$ logout In this scenario the password was sent encrypted over the network. This is why it is very important to handle known_hosts entries properly ...


11

Yes. The password is sent over the encrypted connection, but it's in plaintext to the remote server. The usual way to authenticate is for the server to calculate a hash of the password and to compare it to a value saved on the server. There are several ways of saving hashes, and with current implementations, the client doesn't know what the server uses. (...


2

Yes, ssh sends the password over the network, but after end-to-end encryption has been negotiated. See section 8 of RFC 4252 which says that a password authentication message contains plaintext password in ISO-10646 UTF-8 encoding [RFC3629]


1

If you cannot confirm that key fingerprint as coming from your ubuntu host, the likely cause is that you are not really connecting to the host/service that you think you are. Not only are you getting a different host key, the key length of 1040 seems a bit peculiar. Doing a quick google search on the fingerprint 86:03:d0:87:3d:67:3a:9a:9b:83:7a:39:a7:2e:e7:...


0

This is a slightly more robust way of retrieving the HostName based on Host in the .ssh/config file. sshalias() { awk "\$1==\"Host\" {host=\$2} \$1==\"HostName\" && host==\"$1\" {print \$2}" "$HOME/.ssh/config" }


0

To map from the host argument given on the command line to the ssh_config hostname entry is easy using ssh itself. You can ask it to evaluate and print out what it would use for the configuration for a command line, without actually connecting. Then you simply need to pull out what it lists for hostname (Note that it canonicalizes configuration key names by ...


0

You can try to read the file from the beginning but you need to be sure that you can write it as the same speed at least.


0

A similar problem Another possible lead I had the same problem using ~/.ssh/authorized_keys with permitopen. As I use autossh to create a tunnel, I need two ports: one for connection (10000), one for monitoring (10001). On client side This gave me a similar problem with monitoring port: autossh -M 10001 -o GatewayPorts=yes -o ServerAliveInterval=...


0

A host-only adapter in VirtualBox is almost exactly what it sounds like: the "host" is the box where you run virtualbox at - so most probably the desktop system your display, mouse and keyboard are connected to. "host-only" refers to the circumstance that (out of the box) only your host and your vm are connected to this network via a network bridge on the ...


1

When your command is on the local system, and your file argument is on the remote... Use process substitution. In Bash mpirun -np 16 <(ssh server cat c.x) The <(command) syntax allows you to convert output from a shell command into a file, basically. In Zsh mpirun -np 16 =(ssh server cat c.x) When your file is on the local system and you ...


3

The expect command you use: spawn ssh test@192.168.142.15 ls > ls_from_remotes_sys This, effectively calls exec("ssh","test@192.168.142.15","ls",">","ls_from_remotes_sys") That means the three parameters (ls, > and the filename) are sent to the remote system; ie the redirection happens on the remote system. A kludge could be to call it via sh ...


0

Since rsync version 3.1.0, a --remote-option argument (or its short-form -M) is available to pass arguments through to the server. For example, giving a client the command: $ rsync -av -M --customarg1=value1 -M --customarg2=value2 file1 file2 user@server:some/path will result in the server command receiving the arguments prefixed with -M, but without the -...


1

There are two interactions here. First SSH asks to confirm the server's identity. This is necessary because an adversary might impersonate the server, to tick you into logging in and providing your password or other confidential data. The first time you ever connect to a server, you need to verify the hosts's identity. After this, SSH remembers the ...


3

There is (obviously) manual page for vsftpd.conf, which is always a good place to start. TLDR version: They should be needed only for passive mode of FTP. pasv_enable Set to NO if you want to disallow the PASV method of obtaining a data connection. Default: YES pasv_address Use this option to override the IP address that vsftpd ...


4

Perhaps you could use the -M option (long version --remote-option), which does not seem to be checked by the client rsync. -M-xxxx is passed to the remote with the -M stripped off as -xxxx. You can easily play with this using -M-M-xxxx, which is ignored by client and remote: rsync -av -M-M-myvar=val /tmp/test/ remote:test/ If your server front-end ...


3

This isn't exactly pretty, but it could all be hidden away in a script: SSH can send arbitrary environment variables across the tunnel; both the client and server need to be configured to allow it. The client is easily done with the -o option; the server you'd have to do in your sshd_config file. Accepting arbitrary ones is a bad idea, but something like ...


0

Yes. indeed, just establish password-less ssh authentication first, between the two communicating machines by using the ssh-keygen and ssh-copy-id commands. You ll be good to go. Follow-these-steps


1

The server is actually part of Azure Cloud The error could be occurring anywhere along the network path between the ssh client / mongo client and the server. This may represent a large number of components you will not have access to. Your next port of call (after checking for reboots) should be Microsoft's support (good luck with that). Meanwhile: ...


1

From your question i guess that there is no performance or availability problem , and this seems to be network connectivity problem and may be related to firewalls on your client or target server. There can be multiple ways to investigate. Check the ping response Traceroute to the server from client and from client to server traceroute and tracepath ...


1

Put your long running session inside screen See screen -h for details That way you can reconnect to the machine using ssh and reattach to the screen session


1

Open an SSH connection once, and then piggyback on it. This feature of OpenSSH is called master connections. See Using an already established SSH channel ssh_control_socket="$(mktemp)" ssh -o ControlPath="$(ssh_control_socket)" -o ControlMaster=yes -o ControlPersist=yes administrator@host "mkdir ${DIR}" # other commands using ssh (ssh, scp, rsync, …): pass ...


0

If you have network access from your live CD boot, you should be able to do something like this: get a root shell in the Live CD running on the VirtualBox VM partition and format the virtual disks however you want. If LVM tools are on the Live CD you can even use LVM. run mkdir -p /target mount your intended rootfs on /target, make directories for any ...


1

You don't need to do it as a HERE document (which is what the << stuff does). You can simply do ssh remotehost "command1; command2 ; command3" e.g. % ssh localhost "date ; uptime ; echo hello" sweh@localhost's password: Tue Jul 19 08:07:48 EDT 2016 08:07:48 up 15 days, 31 min, 3 users, load average: 0.33, 0.33, 0.40 hello The scp however, won'...


0

Separating the command using ; worked. ssh $USER_ID@$DESTINATION_SERVER "mv /source1/* /destination1/; mv /source2/ /destination2/; ......"


1

I used to use the script mentioned by steampowered, I've made the below one now, because it doesn't leave files lying around. (Tested on zsh only) #!/bin/sh AGENT_BIN=`which ssh-agent` AGENT_ADD_BIN=`which ssh-add` AGENT_PID=`ps -fe | grep ${AGENT_BIN} | awk -vuser=$USER -vcmd="$AGENT_BIN" '$1==user && $8==cmd{print $2;exit;}'` if [ -z "$AGENT_BIN" ...


0

You're executing the ssh command outside of the context of your session, so you may be missing some things that are normally available. Presumably, you're authenticating with a key. Is the key available from the cron job? If the key file is password-protected, then obviously the key isn't available since you might not have entered the password yet. Even ...


0

I could get this to work on my box, but I'm not sure if sudoers option requiretty would break it. On machine B create program that sudo will use to ask for passwords. e.g. /home/myname/askpass.sh, chmod it +x #!/bin/bash echo "my_password" On machine A create connect script that will establish the ssh connection for the scp and inject sudo + related ...


1

Use autossh, which does this for you. It is designed for persistent connections that don't need manual starting or restarting, are self monitored, and do any of the same tunneling jobs that a normal ssh client does.


2

Use the gui to mount the encrypted directory, then login to the synology as root over ssh and type mount. You will see a line like /volume1/@mycryptdir@ on /volume1/mycryptdir type ecryptfs (rw,relatime,ecryptfs_fnek_sig=88...,ecryptfs_sig=88...,ecryptfs_cipher=aes,ecryptfs_key_bytes=32) This shows your directory /volume1/mycryptdir is implemented on an ...


0

The directory owner and permission are correct. During configuration use the PrivilegeSeparation option. Start the demon as service cygrunsrv -S sshd Example of directory permission on a functional system $ icacls $(cygpath -w /var/empty) E:\cygwin64\var\empty NULL SID:(DENY)(Rc,S,REA,X,DC) MATZERI\cyg_server:(F) ...


3

You need to find the processes that are still running and using established socket connections. One way to do it is: lsof -i :22 | grep -i established | awk '{print $2}' | while read x; do kill $x; done You may need to install lsof since it is not by default installed on arch.


5

Typically, stopping sshd will prevent it from accepting any new connections, but won't kill off existing connections. Once you've done the stop you then need to do something like killall sshd.


2

It works the same way as the multi-hop ssh if you will use the ProxyCommand. The ProxyCommand is transparent regardless what you do above that. Host proxy Hostname proxy.tld User proxy_user Host target Hostname target.tld User target_user ProxyCommand ssh -W %h:%p proxy Then running scp file target: will copy the file over the proxy to the ...


0

I had the same issue today. First thing I noticed was /var/log was at 100% I fixed that and it didn't solve the issue. I couldn't ssh in nor could I login via the GUI, but I could CNTRL+ALT+F2 to get to CLI and login that way. I typed startx and received an error that /tmp/.X0-lock existed. I removed that file (technically I removed everything from /...


3

The problem with telnet is that once it reads end-of-file it will close the connection and you will not see any output. A simple hack is to hold the input open for some extra time, eg: (cat cmds; sleep 15) | ssh root@cc1 telnet MyHost Obviously, this is not a robust solution, so you should use something that is able to detect when the remote has finished,...


4

Simply use, ssh node1 'echo "\$spool_as_final_name true" >> /var/spool/torque/mom_priv/config' Or you can use the cat command, echo "\$spool_as_final_name true" | ssh node1 "cat >> /var/spool/torque/mom_priv/config"



Top 50 recent answers are included