Tag Info

New answers tagged

1

2 shots: 1. Perhaps login as root is denied (that's the default setting on many systems and it is pretty reasonable). Did you tried with a different user? 2. Did you try sshing with ssh -Y?


1

That device looks much like net redirection in bash, for example /dev/tcp/server/22. On Ubuntu 15.04, I could ssh over such a device by putting the following lines in ~/.ssh/config, then running ssh xyz. Host xyz ProxyCommand bash -c 'exec 3<>/dev/tcp/server/22; cat <&3 & cat >&3' Could you try this with replacing ...


1

Try sshrc. Install sshrc on your local machine. Add the following line to ~/.sshrc on your local machine: cp "$SSHHOME/.sshrc.d/.gitconfig" ~/.gitconfig Create ~/.sshrc.d on your local machine: mkdir ~/.sshrc.d Create a symlink: ln -s ~/.gitconfig ~/.sshrc.d/.gitconfig And try sshrc me@myserver See also: Specializing .sshrc to individual servers ...


0

I've found the answer on the GPG Website itself. The agent was failing to find on which screen to display the Pinentry window. I just had to put the following in my .*shrc file: echo "UPDATESTARTUPTTY" | gpg-connect-agent > /dev/null 2&>1


1

Unless I've misunderstood your question, there are a good number of ways to approach this, but what you decide will depend on the preferences of your team so without a working example I'll just be fairly general... I'll mention right now that Git allows commands to be aliased and added onto internally to allow for something like this to be seamless if you ...


0

I've split my answer into two separate answers so you can up/downvote the "wrapper" and "patch" approaches separately. Solution 2: Use the source, Luke! Like I mentioned in the update to my answer, OpenSSH doesn't support Match AddressFamily — yet. It's fairly easy to add a corresponding clause to the Match parsing in readconf.c. My proof-of-concept patch ...


0

I've split my answer into two separate answers so you can up/downvote the "wrapper" and "patch" approaches separately. Solution 1: Write a wrapper function ssh () { controlpath="" for argument in $@ do if [[ "$argument" = "-"*"4"* ]] then controlpath="~/.ssh/tmp/%l_%r@%h:%p.inet" fi if [[ "$argument" ...


5

The feature is called ControlMaster which does multiplexing over one existing channel. It will cause you will do all key exchange and logging in only once and the later commands will go through much faster. You activate it using these three lines in you .ssh/config: Host host.com ControlMaster auto ControlPath ~/.ssh/master-%C # for openssh < 6.7 ...


1

If you have control of the machine to the point that you are automating tasks on it, then why is adding your key to authorized_keys not an option? ssh-copy-id -i ~/.ssh/foo somehost@example.com Then you don't have to enter a password every time you connect. If the biggest problem is that connections take a long time to connect, you could reuse a single ...


4

What you have is a nested screen session (using screen within a screen session). By default, to send commands to the nested session, you hit a second a first: Ctrl + a a command For example, to create a new window in the nested session: Ctrl + a a c From the screen documentation: (C-a a) Send the command character (C-a) to the process in the ...


2

You need more quoting when you pass arguments to SSH. Try this: ssh localhost "df -k / | awk '{print \$3/1024/1024/1024}'" 0 0.00623375 Note the \ before $3.


4

You only disabled ChallengeResponseAuthentication. Lines starting with # are comments and won't interpreted as configuration, they are for humans to read. To disable all possibilities to login with a password you have to set PasswordAuthentication no AND ChallengeResponseAuthentication no There is a possible path over pam_unix to login with a ...


2

A possible idea, from Roland (Cybso) Tapken, is to use rsync --fuzzy with per-date directories Put the archive in directories named by the date and called current.tar and parent.tar, where parent.tar is a hardlink to the previous current.tar. In conjunction with --hard-links this should work, since the Levenshtein Distance of current.tar and ...


2

One thing you might do is to (on the receiving side) copy the last backup file to the new name before starting rsync. Then it will transfer only the diffs between what you have and what you should have. If you do this, be careful if you have rsync -u (update only, based on timestamp) that you ensure that your copy is older than the new source file.


2

There are multiple solutions to notify locally at the end of a script, here are two: Use the beep character at the end, that gives an audible sound: ssh user@host /path/to/script; echo -e '\a' > $(tty) You can eject the CD-drive (my favorite; it doesn't matter what you do, you'll be noticed :-). Also if you go away and come back or lock the machine, ...


0

You don't need to send the mail from the foreign machine. The local machine can send an email on command completion: ssh host cmd ; echo "It's done." | mail me@somewhere -s Completion If you must stay logged in on the remote machine, you can still monitor its command's progress. As an example: $ ssh host 'cmd1 ; echo Done $?; cmd2' | { while read a b; ...


1

Pipe the password into the su, which in turn is piped to ssh. Example below. Note how foopass is the correct password for user foo, so it runs the id command happily. Note how badpass is the wrong password for user foo, so it generates Authentication failure. $ echo "echo foopass | su foo -c id" | ssh -t -o RequestTTY=yes steve@localhost Pseudo-terminal ...


0

Best solution would be to find the problem that avoids server starting from service dropbox start. Check your logs to see what's happened. But in the mean time, you can start your daemon with nohup, that will keep it running after you logout. nohup $HOME/.dropbox-dist/dropboxd &


0

I personally needed to gather a number of files I could only read with sudo and I wanted to do it in one go. ssh user@remote 'cd /path/to; sudo tar zcvf - files*' > files.tar.gz From there you just have to tar xf the file and get all of the files you want.


1

Some firewall between you and the target site is blocking TCP connections to port 22, either by blocking outgoing packets or by blocking the response. You can locate the firewall by running tcptraceroute github.com 22. If the firewall is beyond your control (e.g. on your ISP's equipment), there's nothing you can do without outside help. If your ISP is ...


0

Check if /etc/resolv.conf is empty on the server you're ssh-ing to. Several times I found this to be related to an empty /etc/resolv.conf file If non root, you can just check on the server by trying some ping or telnet (80) on a public hostname, i.e.: root@bananapi ~ # telnet www.google.com 80 telnet: could not resolve www.google.com/80: Name or service ...


0

It may be that a firewall is blocking SSH access to your NAS from external IP addresses, while allowing access from a private IP in the LAN. Check your firewall config (if any) on the NAS and the router.


-2

The used public ip has to be purchase one and should get it from your local ISP. If that so, i think there should not be a problem you to ssh over that public ip address. Is this the case.? Updated "What is my ip" will of course give you a public ip, but note that it is dynamic and not persist to you all the time. OK, let assume what you get by typing ...


0

Add this to your ~/.bashrc: if [ ! -S ~/.ssh/ssh_auth_sock ]; then eval `ssh-agent` ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock ssh-add fi export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock This should only prompt for a password the first time you login after each reboot. It will keep reusing the ssh-agent as long as it says running.


1

In order to attack a server the attacker must first know its IP address. With IPv6 you will have so many addresses to choose from that it is not feasible to find the correct address by scanning the IP range. This means you can simply assign two different IPv6 addresses to the interface. You let the domain name of your site keep pointing to the same IP ...


0

If there are still people encountering this problem, I still could not fix it. I did find a working workaround. The following ruby script did the trick. It creates a folder called "keepalive" over and over. Just keep running this until infinity. $i =1 $num =0 begin puts("Inside the loop i = #$i" ) $i +=1 puts 'creating obj' system 'mkdir ...


3

The short answer is that scp does interesting things when you give it two IP addresses to work with. If your source or destination is the machine running the scp command, then one of your paths should be local. If you're on the MyCloud, try this: WDMyCloud:~# scp Ben@192.168.1.20:/Users/***/Desktop/Apple.jpg /DataVolume/shares/Ben Or if you're on your ...


1

On /etc/rc search for : ssh-keygen -A then delete this line. You should not recreate any keys at startup. I did this and i got no error warning on boot, but if anyone knows a "cleaner" way to do this, please answer! Also this work for OpenBSD only(i think) but should only be a matter of finding the right init script to remove this line on other unix ...


4

Looks like that's a systemd issue currently tracked under bug #751636. When the host is shut down or restarted, systemd might shut down the network before it kills the ssh session. There are a couple of solutions provided but nothing concrete: Using acpid/acpi-support-base to handle the power events & add the following to the ...


2

On arch linux, there is an AUR package dropbear_initrd_encrypt that does what you want out of the box. Works pretty well for wired interfaces. I had to hack it up slightly for wireless.


3

You can just use a here document. su -someuser -c '<&1 >&2 ssh you@machine sh' 1<<\SCRIPT if ! grep 'some spaces or whatever' /etc/somefile then : do something fi #END SCRIPT The solution requires a little fd juggling because you'll need to get past the initial password read from su, and su won't pass on any ...


3

Doing three quotes doesn't help, you just unquote, quote, and unquote again. You also don't need the subshell. What you really want is: su - someuser -c 'ssh someplace "if ! grep \"some thing\" /etc/somefile; then doSomething; fi"' This kind of approach can become unwieldy quickly -- consider just putting a script on your server and executing that. That ...


1

Rather than try and do this in this manner using ssh you might want to use a tool such as pssh. This U&L Q&A titled: Execute a command on multiple hosts, but only print command if it is successful?. In your case you could take the server & command files directly into pssh like so: $ pssh -h server -i -I < commands.txt Example Here I've ...


3

You don't want to overwrite your bash. You want tmux only for interactive sessions and you don't want to do it recursively like in the other answer. Simple example taken from [1], with common use case where you try to attach last session, which can be useful. This should go into your ~/.bashrc. echo Checking for tmux if [ -z ${TMUX} ]; then /usr/bin/tmux ...


0

Are you speaking of launching tmux from your bash configuration file? In that case, you should launch tmux by preceding it by the keyword exec: exec tmux ... in order to have bash being fully replaced by tmux.


2

This is not typical use case so there is no direct way of doing so. But, you can workaround this using user configuration file as such, if you don't require too many remote hosts: Host hostname-4 Hostname hostname AddressFamily inet ControlPath ~/.ssh/master4-%l%h%p%r Host hostname-6 Hostname hostname AddressFamily inet6 ControlPath ...


3

debug1: Connection established. [...] debug1: identity file /root/.ssh/id_ecdsa-cert type -1 ^C When a client connects to an SSH server, the first data exchange is that the server and client send their version strings to each other. The OpenSSH client normally logs this immediately after the list of identity files, for example from my system: [...] ...


1

Check the permissions on your ~/.ssh/authorized_keys file. They should be 0600. Check the permissions on the home (~) directory, and not just the ~/.ssh directory. Alternatively you can create a new set of keys and try : ssh-keygen -t rsa Enter file in which to save the key (/home/demo/.ssh/id_rsa): Press Enter Enter passphrase (empty for no ...


0

Perhaps there is something wrong with your key? You can try and login with a username and password just to make sure its not the key. This wont work if sshd is setup to only accept keys though. Here is an example ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no -p 2221 username@my-server


1

The ProxyCommand is what you need. At my company, all the DevOps techs have to use a "jumpstation" in order to access the rest of the VPC's. The jumpstation is VPN access-controlled. We've got our SSH config setup to automatically go through the jumpstation automatically. Here is an edited version of my .ssh/config file: Host *.internal.company.com User ...


1

openssh does provide ssh-copy-id. The sequence would be: Generate a decent 4k key ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa4k Start your ssh-agent up and suck in information like SSH_AGENT_PID, etc. ssh-agent -s > ~/mysshagent source ~/mysshagent rm ~/mysshagent Now start loading keys into your SSH Agent ssh-add ~/.ssh/id_rsa4k Check that it is ...


1

This is more complicated then subtracting the connection delay. There is visible the function of TCP window adjustment and buffers, which is adjusted on the fly and for larger files it is visible since the speed is increasing from really low to the network throughput limit. More info can be found here: https://en.wikipedia.org/wiki/TCP_tuning#Window_size ...


4

This can happen on systems with auto-mounted home directories, like in a system with Active Directory or LDAP. Type mount after you login to see if your home directory was auto mounted. Unfortunately, there isn't a way (that I know of) to fix this. Usually, an entire /home directory is mounted, so all user's home directories are available during SSH ...


1

The openssh server has a bug in its unsafe character filter which instead of filtering control characters, filters out everything but printable ascii (the spec calls for printable utf8) a patch to the server will fix this.


1

Based on my research in this other U&L Q&A titled: Non-ASCII printable characters in sshd banner it is not possible to get SSH's banner facility to print the escape sequences necessary to colorize the output. This is in fact by design for security reasons. Therefore it's impossible to print an SSH banner in this manner.


2

Performing SSH tunneling can get a bit confusing with all the terminology, but there is a complementary feature to -L, which provides you the ability to "dynamically" assign ports by allocating a socket locally, instead of a single port. From the man page: -D [bind_address:]port Specifies a local ``dynamic'' application-level port forwarding. This ...


4

Use a dynamic DNS service. This is basically a little script or daemon that calls into a dns server so it gets updated whenever the IP changes. There are a number of providers for this service. For home use or only a few addresses you can use a free service like duck dns. I've used them since dyndns kicked off all their free customers and haven't had any ...


0

It is because of the permissions, most probably the ssh executable didn't have permission for the account you were using at that moment. For seeing which file has which permissions to who you can simply type ls -l, then you'll see something weird like drwxrwxr-x 2 pi acctg 1024 date time file name and maybe some more, d in the beginning says its a ...


0

Go to File >> Site Manager >> New Site >> fill the details in, >> select SFTP - SSH File Transfer Protocol >> Logon Type Normal >> Username and password Then click on Connect. That will also save the connection for later use. You get to it the same way and you can rename it as well. I think the quick connect assumes its FTP when you put in a non standard ...



Top 50 recent answers are included