Bash programming has a very helpful command of:
bash -x myscript.sh
This will show you what bash is doing while running through myscript.sh. Python has the same functionality, through this command:
python -m trace --trace myscript.py
Very useful in debugging python programs. Additional info:
http://docs.python.org/library/trace.html
This is a repository of all of my Linux/Unix writings as well as useful tips and tricks for systems administration, engineering, and programming.
Thursday, August 23, 2012
Friday, August 3, 2012
Create ssh public key from private key
If you have a private key and want to create the public key from that (to put in ~/.ssh/authorized_keys, for example), do the following:
ssh-keygen -f <my_private_key> -y > <my_public_key>
For example:
ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub
If you are using this to ssh with keys, add my_public_key (eg. ~/.ssh/id_rsa.pub) to ~/.ssh/authorized_keys on the remote server.
Then ssh with the private key to the remote server to test.
ssh-keygen -f <my_private_key> -y > <my_public_key>
For example:
ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub
If you are using this to ssh with keys, add my_public_key (eg. ~/.ssh/id_rsa.pub) to ~/.ssh/authorized_keys on the remote server.
Then ssh with the private key to the remote server to test.
Subscribe to:
Posts (Atom)