New answers tagged

0

Not sure if this is what you're looking for, but just in case... How can I execute local script on remote machine and include arguments?


0

Looks like your sshd is configured to accept ecdsa key. You can either track down on the server-side why it's only looking for ecdsa keys instead of rsa, or you can resolve this from client side by providing an ecdsa key. The steps to create and use an ecdsa key from the client are as follows: ssh-keygen -t ecdsa -b 256 -N '' -f ~/.ssh/id_ecdsa ssh-copy-...


0

Edit ssh-server configuration file and append at the bottom: root# vim /etc/ssh/sshd_config User newton PermitTTY yes


2

There are two streams of output from a process that are generally sent to the terminal: standard output (which is bound to file descriptor 1), and standard error (which is bound to file descriptor 2). This allows for easily separated capture of expected output, and error messages or other diagnostic information that is not generally expected to be output. ...


1

expect is written in the tcl language, so strings containing whitespace must be quoted with double-quotes " not single quotes '. So replace your spawn line with spawn rsync -arvz -e "ssh -p 1690" --protect-args --progress /home/pappu/ "backup@xx.xx.xx.xx:/volume1/56 - Backup Server/pappu" Also, as mentioned by @steeldriver, a carriage-return is written \...


0

Hope this helps you: #!/usr/bin/expect spawn sftp USERNAME@ip_address:/path/to/folder expect "Password:" send "PASSWORD\n" expect "sftp>" send "put file1\n" expect "sftp>" send "bye\n" or if you don't want to dedicate the whole script to expect: #!/bin/sh expect << 'EOS' spawn sftp USERNAME@ip_address:/path/to/folder expect "Password:" send ...


0

echo "Sending files to destination" USER='(username)' PASSWD='(********)' sftp user@ip_address << EOF quote USER $USER quote PASS $PASSWD cd path put file1 bye EOF


-1

echo "ftping files to destination" USER='(username)' PASSWD='(********)' sftp user@ip_address << EOF quote USER $USER quote PASS $PASSWD cd path put file1 bye EOF


1

exit 1 signals an error condition. For a script like this you should not include an exit there. Try this function instead. You can provide the host and port on the command line for startManagedWeblogic.shm, or you can export the variables before starting the server. If you read the startManagedWebLogic.sh script, you should find a variable you can export ...


0

This thing worked for me. But in this the ssh connection will keep alive. require 'net/ssh' Net::SSH.start('xx.xxx.xxx.xxx', 'root', :password => "XxXxXxXx") do |ssh| channel = ssh.open_channel do |ch| ch.exec "cd /home/ && wget my_script_from_the_server.sh && chmod +x wazir-init.sh && ./wazir-init.sh" do |ch, success| ...


6

It shows ? since there is no TTY (terminal interface) to which this process is attached. This is fortunate since sshd is a system daemon and should not be dependent on a client session. As mentioned in the comments, closing a session will terminate all related processes for that TTY, which is not desired for system wide processes.


5

When troubleshooting problems with daemons, you should always check the system logs. In this particular case, if you check your system logs on the NAS host, you'll see something similar to: Authentication refused: bad ownership or modes for directory /home/admin The problem is shown in this output: admin@NAS:~$ ls -alh drwxrwxrwx 6 admin users 4.0K Jun ...


1

Any chance you created a password for your private key while creating it using ssh-keygen. Following is the workflow I use: ssh-keygen ssh-copy-id root@remote_host scp /test.text root@remote_host:/opt/application/


1

You can set the option UseDNS no in the file /etc/ssh/sshd_config on your server to tell sshd(8) not to do DNS lookups.


2

Sshd doesn't care where the connection is coming from, if it's configured to do a reverse DNS lookup, it does.


3

It is possible to add multiple lines of LocalForward: Host myhost Hostname 123.123.123.123 IdentityFile ~/.ssh/id_myhost LocalForward 8811 localhost:8811 LocalForward 6006 localhost:6006 IdentitiesOnly yes Is this what you want?


0

Have you tried rdocker? It looks exactly what you are looking for. Enjoy


2

You can use a parallel shell such as clustershell or pdsh. This way, assuming you already set up a passwordless SSH authentication from a central machine, you can run a command on each of the 100 servers at the same time. You can also go further and do various groups in order to organize them logically. Lets assume your machines are named aws0, aws1, aws2, ...


0

I'm an idiot. I had some wacky iptables rules set up on my server. After clearing all those out, everything works fine. Sorry for the fuss.


0

try this maybe install brew brew install openssh --with-brewed-openssl --with-keychain-support


0

check this out: multitail MultiTail allows you to monitor logfiles and command output in multiple windows in a terminal, colorize, filter and merge.


1

Much easier way would be to disable hashing of your known_hosts with HashKnownHosts no in your ~/.ssh/config to allow autocomplete from all history, or just list your hosts in your ~/.ssh/config (you can store there all your Ports and Users, or create aliases). I appreciate the creativity, but why to reinvent wheel when we have got already the same ...


1

So as I only and only want to know how to autocomplete my hosts targets within the bash_history file, I found this feature hoping to help anybody in the same situation. Just execute the following line $ complete -W "$(echo $(grep '^ssh ' .bash_history | sort -u | sed 's/^ssh //'))" ssh complete - is a bash builtin function. So there is not a binary on ...


1

suggestion: zfs send > file scp file server-at-site2: ssh server-at-site2 zfs receive < file ssh server-at-site2 cat file | ssh second-server-at-site2 zfs receive That requires two transfers, but presumably the second will be faster (because local network, etc)


2

Remove the double-quotes from the loop items in the for lines - you're iterating over single strings ("air hgt rhum uwnd vwnd" and "00 06 12 18"), not lists of items. Also, type is a reserved word in bash. Use another variable name, e.g. t, instead. Finally, you should always double-quote your variables when you use them. Putting that all together, try ...


0

I have the same problem. According to my tests, it is not related to the server, instead it has something to do with the client. Either ssh build and configuration, either due to the local network configuration. I've been able to create a tap interface between my laptop and all of my devices but when I tried to tunnel between the devices, only tun ...


0

Setting the login shell is a step in the right direction, but has a pitfall: it interferes with running scripts by setting $SHELL, which is used by many scripts. That is not how dialog is supposed to work. Rather, if one sets up an account whose shell initialization scripts run your menu script and make the script trap any keyboard interrupt, and logout ...


0

I'm assuming you want this because you need to talk to a device in the other side of the serial port from the ssh connection, and that it's not a modem or some such (where you could use the network stack). If the command that you want to write from can run a command and communicate to that using stdin and stdout, you can just use SSH itself, since SSH ...


0

I'm not totally sure about the first part of the pipe you give as an example, but if you can somehow configure the program that writes to a serial port to use your fake serial port, you can simply write: socat pty,link=$HOME/ttyFAKE,raw,echo=0 - | ssh user@host "tee /dev/ttyREAL" socat will create the device for you.


1

Perhaps you can do something like this example using socat which creates a pseudo-tty and a symbolic link to it in ~/myserialline. When you open it socat runs ssh (in this example to localhost) where it runs socat to join stdin/stdout to a real serial device. socat PTY,link=$HOME/myserialline,raw,echo=0 EXEC:'ssh localhost socat - /dev/ttyS0' You can ...


3

Using synopsis scp host1: host2:, then the scp first connects to the first host1 and then tries to connect to the host2 from there (unfortunately not described in manual page). This means that the host2 have to be resolvable from host1 and also you need to be able to authenticate to this host from host1. There is a note in manual page for scp: -3 ...


2

Mosh will probably increase your data usage. It is designed to increase reliability and responsiveness, or at least the illusion of it. From this discussion, we know that mosh's predictive capabilities actually causes an extra packet being sent per keystroke. If you are concerned about metered data usage, you might want to use the lowbandwidth branch of ...


1

The shell that you get when you execute a command remotely with SSH is neither an interactive shell nor a login shell: $ ssh server 'bash -c "echo $-"' chsB (there's no i and no l in the response) In Bash's case that means that none of the usual initialization files are read. You can force the remote shell to be a login shell by adding -l to your Bash ...


0

I had the same problem, and at first shopt -s expand_aliases didn't seem to help. What I've found out is that this options should be set before adding the actual aliases. So if aliases are created before your .bashrc sets the expand_aliases options, they won't be available. Therefore, you should load (or reload) aliases after setting the option.


1

If you can SSH to localhost, but you can't SSH from another machine, then either you changed the SSH configuration to forbid SSH from other machines, or there's a firewall that blocks incoming SSH connections. The firewall could be on the same machine, or on any hop between the client you're testing from and that server. If SSH works on the default port but ...


2

Server log says sshd: /etc/ssh/sshd_config: No such file or directory This means the the server is unable to open the file for some reason. Check if the file exists and if it has appropriate permissions (including SELinux labels) ls -lZ /etc/ssh/sshd_config should give you enough information to figure this out (restorecon /etc/ssh/sshd_config should ...


-1

It's because of ip conflict, I have same kind of issue, you should not use the same ip for other vm's. Even if you delete it, ip won't be released. try with another ip in the same network it should work.


-2

Once I faced some weird errors because commented lines were without space between the character # and the text. correct: # no default banner path incorrect: #no default banner path


3

Instead of: ls /var/log/hello grep -i hello.log. | echo "" | xargs echo "" | sudo tee Try: for f in /var/log/hello/*hello.log.*; do sudo truncate --size 0 "$f"; done To send this over SSH, put it in single quotes, not double quotes: for server in $(cat c10_servers.txt); do ssh "$server" 'for f in /var/log/hello/*hello.log.*; do sudo truncate --size ...


0

When trying to forward to XQuartz on macOS, I fixed the issue by running the ssh command (ssh -Y in my case) from the XQuartz terminal (opened by right-clicking the XQuartz icon in the dock and clicking Applications > Terminal).


0

The mussh command will output only errors so you can just give run it without debug. $ cat list.txt 10.1.2.93 trustme 10.1.2.92 wobudong 10.41.41.41 failhost $ awk '{print $2}' list.txt | mussh -H - -t 10 -m -c hostname trustme: trustme failhost: ssh: Could not resolve hostname failhost: Name or service not known wobudong: ssh: connect to ...


3

Configuration is OK, but you need to have some identities in your ssh-agent to be able to authorize the sudo operation. You can verify that your agent has some identities using ssh-add -L It should print the public keys in your agent and at least one of them should match the public key on server in /etc/security/authorized_keys. If the agent does not ...


1

While I do not condone this practice, I will answer the question on how you would go about sshing into your machine, and what you do with it is your own prerogative. With that being said, a few things you may have missed Use your External IP address, not your LAN/WAN IP. The fact that you are using the Port Checker implies that you have done this part, ...


3

This is wrong syntax in bash: nohup ./NEW_SCRIPT_NAME.sh & && rm NEW_SCRIPT_NAME.sh From Shellcheck: Line 1: nohup ./NEW_SCRIPT_NAME.sh & && rm NEW_SCRIPT_NAME.sh ^-- SC1070: Parsing stopped here. Mismatched keywords or invalid parentheses? You can not simply run something & && something, ...


2

Does it mean that both the server and the client produce the same session key in the same session.? Yes, as it is visible from the picture in the recent question. If yes, why does it also say that "This is an asymmetrical key"? No idea. You better ask a author of the article. Asymmetric cryptography is used to create shared secret, but I have no ...


2

I would redirect it to a tmp file. ssh -M -S /invalid/path/forwarder.socket -fnNT -Llocalhost:6301:remote_server:22 proxy_server 2> /tmp/tunnel.err 1> /tmp/tunnel.out And check that file with ERROUT=$(cat /tmp/tunnel.err) and STDOUT=$(cat /tmp/tunnel.out)


0

First a bit of relationship advice: If you do not trust your girlfriend, that is not the person for you. Instead of trying to spy on her, work on finding a better match. Second tangent to this, depending on your locality, and this is valid for most any placed with a lick of privacy laws, what you are planning to do is a considered a crime, i.e., recording/...


2

As you mentioned in the comment you want to check current date's file in remote directory, you can do that in following manner: FILE=$(ssh -q "$USER"@"$HOST" 'find /home/oracle/SABARISH/logs/sftp -type f -daystart -mtime -1 | wc -l') if test "$FILE" -eq 0; then exit else # do your SFTP stuff here fi from man find : -daystart Measure ...


5

You are creating SOCKS proxy with tunnel from your local computer to your localhost. But from the localhost to the target server (example.com), the data re not encrypted anymore. Diagram: [browser] ==SOCKS== [localhost:1080] ==SSH== [localhost] ==HTTP== [example.com] (where only the SSH part, meaning SSH tunnel, is encrypted) You can encrypt this SOCKS ...


2

You probably have in your ssh_config in ~/.ssh/config a line like Host * IdentityFile /home/%d/.ssh/id_rsa.pub or similar. This have two problems. Substitution %d means whole home directory and IdentityFile option should get the private key, not the public one. The reason why it asks for passphrase is described in this upstream bug (in short, OpenSSH ...



Top 50 recent answers are included