-
Create a file in /etc/profile.d/ directory
- myAlias.sh
-
Define the alias in the file
alias gotoserver1="ssh [email protected]"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On the server target: | |
- Create (if not exists) a blank file named "authorized_keys" in /home/<username>/.ssh/ | |
- Download PuttyGen | |
- Open PuttyGen | |
- Click on "Generate" | |
- Keep mooving mouse on blank area | |
Once keys are generated: | |
- Copy public key and paste it in the "authorized_keys" file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on server1 logged as root | |
root@server1: sudo su | |
root@server1: ssh-keygen -t RSA | |
root@server1: cd root/.ssh/ | |
//append server1's public key to server2's /root/.ssh/authorized_keys file | |
root@server1: ssh-copy-id -i id_rsa.pub root@server2 | |
Now you can log into server2 as root without password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: https://www.cs.colostate.edu/helpdocs/vi.html | |
u ctrl+z | |
MOVING CURSOR | |
0 (zero) move cursor to start of current line (the one with the cursor) | |
$ move cursor to end of current line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp filename.txt{,.BACKUP} Equals to "cp filename.txt filename.txt.BACKUP" |
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
sudo yum localinstall jdk-8u131-linux-x64.rpm -y