Skip to content

Instantly share code, notes, and snippets.

@tinhtun
Last active October 19, 2018 05:13
Show Gist options
  • Select an option

  • Save tinhtun/02fc93c85bf8bf6f24e8fc405ab95bbb to your computer and use it in GitHub Desktop.

Select an option

Save tinhtun/02fc93c85bf8bf6f24e8fc405ab95bbb to your computer and use it in GitHub Desktop.
#tinhtun #linux

Permissions

Add tomcat8 group to current login user

usermod -a -G tomcat8 $USER

Put the tomcat user as the owner of the folder of tomcat

chown -R tomcat8:tomcat8 /var/lib/tomcat8

Owner can read, write, execute. Everyone else can read, execute.

chmod -R 755 /var/lib/tomcat8/logs

Miscellaneous

Print hostname

hostname

Current login user variable

echo $USER

Public Key Authentication with SSH

Create id_rsa and id_rsa.pub in local home/.ssh folder

λ ssh-keygen -b 4096

Copy public key into remote home/.ssh/authorized_keys

λ scp C:\Users\tin\.ssh\id_rsa.pub admin@REMOTE_HOST:~/.ssh/authorized_keys

Now you can login with just passphrase of KeyPair, if any

λ ssh admin@REMOTE_HOST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment