To start with, I apologize if this is a painfully obvious/trivial issue, I'm still learning the ins and outs of linux/unix.I work with a few servers that require access via ssh and private key to log into. So, the command is something like this:ssh -i /path/to/key.pem user@000.000.000.000I've created a bash script that let's me just use my own call, access, and just has a basic switch statement for the arguments that follow to control which server I log into. For example, access server1 would issue the appropriate ssh command to log into server1.The ProblemThe ssh call just hangs up and I'm left with an empty terminal that won't accept SIGINT (Ctrl + C) and I must quit the terminal and open it up again to even use it.As far as I can tell, this might be a permissions thing for the private key. Its permissions are currently 600. Changing it to 644 gives me an error that the permissions are too open and exits the ssh attempt. Any advice?
Unable to SSH Using a Private Key Through Bash Script
bash;shell script;ssh;permissions
There is ssh_config, made for this, where you can specify your hosts aliases and keys and store it without creating such hara-kiri as bash scripts to do so. It is basically stored in your ~/.ssh/config in this format:Host host1  Hostname 000.000.000.000  User user  IdentityFile /path/to/key.pemand then you can simply call ssh host1to get to 000.000.000.000If you really want to be effective and have even shorter shortcuts, bash alias is more suitable than the bash scripts.alias access=ssh -i /path/to/key.pem user@000.000.000.000If you really want to use bash script, you need to force ssh to allocate you TTY on remote server using -tt option:ssh -tti /path/to/key.pem user@000.000.000.000For more tips, you can browse through the manual page for ssh and ssh_config.