Skip to content

Instantly share code, notes, and snippets.

View gdellicarpini's full-sized avatar

gdellicarpini

View GitHub Profile
@gdellicarpini
gdellicarpini / SSH Login with Private Key.txt
Created October 19, 2017 08:47
How to ssh to remote server using private key instead of password.
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
@gdellicarpini
gdellicarpini / ssh_login_without_password
Created October 30, 2017 15:49
SSH login without password (public-private key)
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.
@gdellicarpini
gdellicarpini / vi_commands
Last active November 3, 2017 09:59
VI Commands
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
@gdellicarpini
gdellicarpini / aliases_centos.md
Last active July 21, 2024 22:28
Add permanent aliases in Linux CentOS

Aliases for all users

  • Create a file in /etc/profile.d/ directory

      - myAlias.sh
    
  • Define the alias in the file

      alias gotoserver1="ssh [email protected]"
    
@gdellicarpini
gdellicarpini / linux_commands
Created November 29, 2017 11:34
Linux usefull commands
cp filename.txt{,.BACKUP} Equals to "cp filename.txt filename.txt.BACKUP"
@gdellicarpini
gdellicarpini / howto_centos7_install_jdk8.md
Last active April 17, 2018 11:02
centos7, install, jdk, oracle
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