Problem: Want to run command after SSH connected.
Solution: if you are using Ubuntu, enter:
echo 'command' >> ~/.bashrc
if you are using Centos, enter:
echo 'command' >> ~/.bash_profile
Problem: Want to run command after SSH connected.
Solution: if you are using Ubuntu, enter:
echo 'command' >> ~/.bashrc
if you are using Centos, enter:
echo 'command' >> ~/.bash_profile
Ref: https://stackoverflow.com/a/52113739
Ref: https://stackoverflow.com/a/18683544
Problem: When using SSH to connect other server, I don’t want to type passphrase everytime:)
For Windows 10 you need PowerShell to active ssh-agent in order to save passphrase.
Solution: First use Administrator right to open PowerShell (Windows PowerShell).
Then enter below command to active ssh-agent:
local Administrator PowerShell Set-Service ssh-agent -StnartupType Automatic Start-Service ssh-agent Get-Service ssh-agent
Then now you can add the key file (My file store in C:\Users\user.ssh\id_rsa), it will prompt a message to obtain the passphrase.
ssh-add C:\Users\user.ssh\id_rsa (Enter your passphrase)
Eventually, ssh-agent will store your passphrase now. You can also enter
ssh-add -l
to check out the record.
ref:https://stackoverflow.com/a/31520672
Problem: Want to deploy node.js, but npm is too old.
Solution: Run PowerShell as Administrator (search “PowerShell”, right click and select Run as Administrator)
then run below command
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade