Initial steps when setting up an ubuntu server

August 9th 2022/Share/Edit

Quick initial steps on how to setup a linux server environment.

Create the user

adduser scott

Adding the User to the sudo Group

usermod -aG sudo scott

Testing Sudo Permissions - Log into New User

su scott

Add SSH Keys via ssh-copy-id

ssh-copy-id username@remote_host

Disable Password Login

open config file:
vim /etc/ssh/sshd_config

disable password:
PasswordAuthentication no

disable root login:
PermitRootLogin no

restart ssh:
sudo systemctl restart ssh

Miscellaneous Commands

Python-is-Python3

sudo apt install python-is-python3

alternatively:
sudo apt install python-is-python2

Copy Files via SSH

Copy something from another system to this system:

scp username@hostname:/path/to/remote/file /path/to/local/file

Copy something from this system to some other system:

scp /path/to/local/file username@hostname:/path/to/remote/file  

Change File Ownership

chown -R USER:GROUP DIRECTORY