traceroute
is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol (IP) network
traceroute example.com
https://linuxmoz.com/vi-commands-cheat-sheet/
u (undo)
control + r (redo)
dd (delete the line)
/keyword (search word)
n (move forward to next search result)
N (move backward to previous search result)
:q! (discard change and quit)
:wq (save change and quit)
cd ~
cd ~/.ssh/
ssh-keygen -t rsa
less keyname
less keyname.pub
cat ~/.ssh/my_key.pub
Log as root
ssh -i ~/.ssh/ my_key root@128.199.166.66
top
htop is better one than just top
apt-get install htop
htop
apt-get update
sudo tail -f /var/log/auth.log
adduser username
usermod -aG sudo username
id -G -n username
passwd username
su username
and
exit
Will be back to the root user.
cat /var/log/auth.log
It will go for permission denied
sudo !!
or
sudo cat /var/log/auth.log
ssh username@128.199.166.66
If the console reports permission denied (publickey)
, please do following:
vim /etc/ssh/sshd_config
UsePAM yes
IgnoreUserKnownHosts no
PasswordAuthentication no
to
UsePAM no
IgnoreUserKnownHosts no
PasswordAuthentication yes
and save the change 3. restart ssh service
service ssh restart
Problem resolved! Let’s ssh again and login to the server now. But watch out, login server via the pwd is dangerous. Let introduce a much safer way below.
It is much better secure comparing to just pwd.
cat my_key.pub | ssh username@128.199.166.66 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
What did these lines do?
.ssh
folderauthorized_keys
fileAnd it might ask about the pwd.
Juts type in and hit enter.
Now login without pwd.
ssh -i ~/.ssh/my_key -p 1234 username@128.199.166.66
sudo vim /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
to
PermitRootLogin no
PasswordAuthentication no
Save the changes and quit 3. restart the service
sudo service ssh restart
A Record
. That means:Type: choose 'A Record'
Host: one is '@', another is 'www'
value: 128.199.166.66
nslookup domain.com
It will list the domain info.
sudo apt-get install nginx
sudo service nginx start
Go and verify it via the domain or ip address 4. check the config
cat /etc/nginx/sites-available/default
or
less /etc/nginx/sites-available/default
sudo apt-get install git
sudo apt-get install nodejs npm
node -v
and see whether the env is in the node env.
If it is not working, symlink nodejs
to node
usingsudo ln -s /usr/bin/nodejs /usr/bin/node
www
foldersudo mkdir -p /var/www
root
to the choose userBefore that, let’s see who is the owner of the folder.
ls -l /path/to/file/or/folder
Then.
sudo chown -R $USER:$USER /var/www
or specify user and group
sudo chown -R username:usergroup /var/www
Be careful with this command and only use it when the user really need the all the permission to one folder.
rmdir tmp tmp2
or
rmdir tmp*
mv incorrectname correctname
pm2, nodemon, forever… Choose one and follow the instructions.