Tag Archives: ssh

SSH Autocompletion – Disable using /etc/hosts – brew

I use the bash-completion keg from homebrew to get better bash-completion on Mac OS X. You can install it with brew install bash-completion You can also get some information about it using: brew info bash-completion It will tell you something like: bash-completion: stable 1.3 http://bash-completion.alioth.debian.org/ /usr/local/Cellar/bash-completion/1.3 (187 files, 1.1M) * From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/bash-completion.rb ==> Caveats Add the following lines to your ~/.bash_profile: if [ -f $(brew –prefix)/etc/bash_completion ]; then . $(brew –prefix)/etc/bash_completion fi Homebrew’s own bash completion script has been installed to /usr/local/etc/bash_completion.d Bash completion has been installed to: /usr/local/etc/bash_completion.d To find out where the file that does all the work is stored, run: echo $(brew –prefix)/etc/bash_completion It will probably tell you something like: /usr/local/etc/bash_completion That file has a lot of comments in it, one of the gems being: _known_hosts_real() # Helper function for completing _known_hosts. # This function performs host completion based on ssh’s config and known_hosts # files, as well as hostnames reported by avahi-browse if # COMP_KNOWN_HOSTS_WITH_AVAHI is set to a non-empty value. Also hosts from # HOSTFILE (compgen -A hostname) are added, unless # COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an empty value. # Usage: _known_hosts_real [OPTIONS] CWORD # Options: -a Use aliases # -c Use `:’ suffix # -F configfile Use `configfile’ for configuration settings # -p PREFIX Use PREFIX # Return: Completions, starting with CWORD, are added to COMPREPLY[] The short story is that if you set up something in your ~/.bash_profile file like this: export COMP_KNOWN_HOSTS_WITH_HOSTFILE=”” #don’t use /etc/hosts for ssh autocomplete Then your ssh autocomplete … Continue reading

Posted in Tech Tips | Tagged , , | Leave a comment

ssh command returns “stdin: is not a tty”

If you run a command via ssh (secure shell) on linux and you get the following output: stdin: is not a tty The most common cause is the mesg y or similar command found in the file: /etc/bashrc What is mesg ? mesg is a Unix command that sets or reports the permission other users have to write to your terminal using the talk and write commands. How can I fix this issue? Option 1 would be to comment out the line. Option 2 would be to change the line to something like this to only invoke the command when you are actually using a connection with tty: if tty -s; then mesg y; fi

Posted in Linux, Server Administration | Tagged , | Leave a comment

Remote Desktop to Raspberry Pi from OS X w/ ssh XForwarding

Can you already ssh into your raspberry pi? In short, you will need to make sure you have a public key in the /home/pi/.ssh/authorized_keys directory. The directory should be chmod 700 and the file chmod 600. Good. If not see the notes below. You can then SSH to the box with something like: ssh [email protected] -i /path/to/private.key -X The -i option will specify your private key and -X will turn on X Forwarding. Once you’ve logged in you should be able to run lxsession to start the Lightweight Desktop (LXDE): If you can’t already SSH into your pi, fusionstrike has some notes on how to set that up. One more note: don’t try and do this as the root user. You may get some errors about A window manager is already running on screen – do it as the pi user as I mentioned above.

Posted in Server Admin | Tagged , , , | Leave a comment

Dotcloud – Warning: Identity file not accessible: No such file or directory.

If you’re using dotcloud and realize that you’re getting this error: Warning: Identity file ~/.dotcloud/dotcloud.key not accessible: No such file or directory. You are probably using the old version of the API / CLI. Make sure you upgrade both the CLI and API and also the application. You may also want to use the dotcloud info yourapp.www to get information such as the ssh connect string ([email protected]) and correct port. The correct for direct ssh would be: `ssh [email protected] -i ~/.dotcloud/dotcloud.key -p 5678` Make sure to replace the port numbers and domain string appropriately. See this article: http://docs.dotcloud.com/guides/copy/

Posted in Tech Tips, Web Development | Tagged , , | Leave a comment

Unmount sshfs on Mac OS X

Posted in Mac, Tech Tips, Web Development | Tagged , , | 1 Comment