Sunteți pe pagina 1din 38

3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

UBUNTU  13 I  TecMint :     

 BEGINNER'S GUIDE FOR LINUX 


Initial Ubuntu Server Start learning Linux in minutes 

Setup for Beginners


20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 1/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

by Matei Cezar | Published: October 27, 2017 |


RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
October 27, 2017

SPONSORED SEARCHES

ubuntu server for beginners

host vps server

 Download Your Free eBooks NOW - 10 Free


Linux eBooks for Administrators | 4 Free Shell
Scripting eBooks

This tutorial will guide you


on the rst basic steps you SHARE  Vi/Vim Editor BEGINNER'S GUIDE 
Learn vi/vim as a Full Text Editor 
need to con gure on a new
+
installed Ubuntu server in
order to increase security 
and reliability for your
0
server.

The con gurations
0
explained in this topic are
almost the same for all

Ubuntu server systems,
0
regarding of the underlying
OS platform, whether
  Linux Foundation Certi cation 
Ubuntu is installed on a
bare-metal server, in a Exam Study Guide to LFCS and LFCE

private virtual machine or a


virtual machine spinned-out  
in a VPS public cloud.
How to Add Linux Host to Nagios Monitoring
Requirements Server Using NRPE Plugin

Ubuntu Server Edition How to Install Nagios 4.3.4 on RHEL, CentOS and
Fedora
installation
Install Cacti (Network Monitoring) on
20 Funny Commands of Linux or Linux is Fun in7.x/6.x/5.x
RHEL/CentOS Terminal and Fedora 24-12
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 2/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

Update and
RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
Google Chrome 72 Released – Install on

Upgrade Ubuntu RHEL/CentOS and Fedora

System How to Install Ubuntu 16.10/16.04 Alongside With


Windows 10 or 8 in Dual-Boot
The rst step you need to
take care of in case of fresh
installation of Ubuntu server
or a new deployed Ubuntu
VPS is to make sure the
system and all system
components, such as the
kernel, the package
manager and all other
installed packages are up-
to-date with the latest
released versions and
security patches.

To update Ubuntu server, to


log in to server’s console
with an account with root
privileges or directly as root
and run the below Linux System Administrator Bundle
with 7-Courses (96% off)
commands in order to
perform the update and
upgrade process.
Add to Cart - $69
 Ending In: 3 days

$ sudo apt update


Computer Hacker Professional
Certi cation Course (96% Off)

Add to Cart - $59


Update Ubuntu Server
 Ending In: 4 days

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 3/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
ISO 14001:2015 - Free eBook Download
LINUX EBOOKS
Learn how to be prepared and have a smooth transiti

Introducing Learn Linux In One Week and Go


After running the update from Zero to Hero
command, you will see the RedHat RHCE/RHCSA Certi cation Preparation
number of available Guide

packages for upgrading Linux Foundations LFCS/LFCE Certi cation

process and the command Guide

used for listing the Post x Mail Server Setup Guide for Linux

packages upgrades. Ansible Setup Guide for Linux


Django Setup Guide for Linux
Awk Getting Started Guide for Beginners
$ sudo apt list --upgra
Citrix XenServer Setup Guide for Linux

    

Never Miss Any Linux Tutorials,


Guides, Tips and Free eBooks
Join Our Community Of 150,000+ Linux Lovers
and get a weekly newsletter in your inbox

YES! SIGN ME UP

List Upgrade Ubuntu Packages

After you’ve consulted the


list of packages available for
upgrading, issue the below
command to start system
upgrade process.

$ sudo apt upgrade

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 4/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Upgrade Ubuntu Server Packages

In order to remove all locally


downloaded deb packages
and all other apt-get caches,
execute the below
command.

$ sudo apt autoremove


$ sudo apt clean

Autoremove APT Packages and Cache

Create New
Account in
Ubuntu
By default, as a security
measure, the root account is Commands of Linux or Linux is Fun in Terminal
20 Funny
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 5/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

completely
RedHat disabled
RHCSA in
and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
Ubuntu. In order to create a
new account on the system,
log in to the system with the
account user with root
privileges and create a new
account with the below
command.

This new account will be


granted with root powers
privileges via sudo
command and will be used
to perform administrative
tasks in the system. Make
sure you setup a strong
password to protect this
account. Follow the adduser
prompt to setup the user
details and password.

$ sudo adduser ubuntu_u

Create User in Ubuntu

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 6/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

If this account
RedHat RHCSAwill
andbe
RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
assigned to another system
admin, you can force the
user to change its password
at the rst log in attempt by
issuing the following
command.

$ sudo chage -d0 ubuntu

For now, the new added user


cannot perform
administrative tasks via
sudo utility. To grant this
new user account with
administrative privileges you
should add the user to
“sudo” system group by
issuing the below command.

$ sudo usermod -a -G su

By default, all users


belonging to the “sudo”
group are allowed to
execute commands with
root privileges via sudo
utility. Sudo command must
be used before writing the
command needed for
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 7/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

execution,
RedHat as shown
RHCSA in theCerti cation Exam Study Ebook ($39.99)
and RHCE Get This Book   
below example.

$ sudo apt install pack

Test if the new user has the


root privileges granted, by
logging in to the system and
run the apt update
command pre xed with
sudo.

$ su - ubuntu_user
$ sudo apt update

Verify New User

Con gure System


Hostname in
Ubuntu
Usually, the machine
hostname is set-up during
the system installation
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 8/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

processRHCSA
RedHat or whenand
theRHCE
VPS isCerti cation Exam Study Ebook ($39.99) Get This Book   
created in the cloud.
However, you should change
the name of your machine in
order to better re ect the
destination of your server or
to better describe its nal
purpose.

In a large company,
machines are named after
complex naming schemes in
order to easily identify the
machine in datacenter’s
racks. For instance, if your
Ubuntu machine will operate
a mail server, the name of
the machine should re ect
this fact and you can setup
machine hostname as
mx01.mydomain.lan, for
example.

To show details about your


machine hostname run the
following command.

$ hostnamectl
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 9/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

In orderRHCSA
RedHat to change
andthe name
RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
of your machine, issue
hostnamectl command with
the new name you will
con gure for your machine,
as illustrated in the below
excerpt.

$ sudo hostnamectl set-

Verify the new name of your


system with one of the
below commands.

$ hostname
$ hostname -s
$ cat /etc/hostname

Set Hostname in Ubuntu Server

Setup SSH with


Public Key
Authentication in
Ubuntu 20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 10/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

To increase
RedHat system
RHCSA security
and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
degree of an Ubuntu server,
you should set-up SSH
public key authentication for
an local account. In order to
generate SSH Key Pair, the
public and private key, with a
specifying a key length, such
as 2048 bits, execute the
following command at your
server console.

Make sure you’re logged in


to the system with the user
you’re setting up the SSH
key.

$ su - ubuntu_user
$ ssh-keygen -t RSA -b

Setup SSH Keys in Ubuntu

While the key is generated,


you will be prompted to add
passphrase in order to
secure the key. You can
enter a strong passphrase or
choose to leave the
passphrase blank if you
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 11/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

want toRHCSA
RedHat automate
andtasks
RHCEviaCerti cation Exam Study Ebook ($39.99) Get This Book   
SSH server.

After the SSH key has been


generated, you can copy the
public key to a remote
server by executing the
below command. To install
the public key to the remote
SSH server you will need a
remote user account with
the proper permissions and
credentials to log in to
remote server.

$ ssh-copy-id remote_us

Copy SSH Key to Remote Server

You should be able to


automatically log in via SSH
to the remote server using
the public key authentication
method. You won’t need to
add the remote user
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 12/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

password
RedHat whileand
RHCSA using SSHCerti cation Exam Study Ebook ($39.99)
RHCE Get This Book   
public key authentication.

After you’ve logged in to the


remote server, you can start
to execute commands, such
as w command to list ssh
remote logged in users, as
shown in the below
screenshot.

Type exit in the console to


close the remote SSH
session.

$ ssh remote_user@remot
$ w
$ exit

Verify SSH Passwordless Login

To see the content of your


public SSH key in order to
manually install the key to a Commands of Linux or Linux is Fun in Terminal
20 Funny
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 13/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

remote RHCSA
RedHat SSH server,
and issue
RHCEthe
Certi cation Exam Study Ebook ($39.99) Get This Book   
following command.

$ cat ~/.ssh/id_rsa.pub

View SSH Key

Secure SSH
Server in Ubuntu
In order to secure the SSH
daemon you should change
the default SSH port number
from 22 to a random port,
higher than 1024, and
disallow remote SSH access
to the root account via
password or key, by opening
SSH server main
con guration le and make
the following changes.

$ sudo vi /etc/ssh/sshd

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 14/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

First, search
RedHat RHCSAtheand
commented
RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
line #Port22 and add a new
line underneath (replace the
listening port number
accordingly):

Port 2345

Don’t close the le, scroll


down and search for the line
#PermitRootLogin yes,
uncomment the line by
removing the # sign
(hashtag) from the
beginning of the line and
modify the line to look like
shown in the below excerpt.

PermitRootLogin no

Secure SSH Service

Afterwards, restart the SSH


server to apply the new
settings and test the
con guration by trying to log
in from a remote machine to
this server with the root
account via the new 20
port
Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 15/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

number.RHCSA
RedHat The access to rootCerti cation Exam Study Ebook ($39.99)
and RHCE Get This Book   
account via SSH should be
restricted.

$ sudo systemctl restar

Also, run netstat or ss


command and lter the
output via grep in order to
show the new listening port
number for SSH server.

$ sudo ss -tlpn| grep s


$ sudo netstat -tlpn| g

Verify SSH Port

There are situations where


you might want to
automatically disconnect all
remote SSH connections
established into your server
after a period of inactivity.
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 16/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

In orderRHCSA
RedHat to enable
andthis
RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
feature, execute the below
command, which adds the
TMOUT bash variable to
your account .bashrc hidden
le and forces every SSH
connection made with the
name of the user to be
disconnected or dropped-
out after 5 minutes of
inactivity.

$ echo 'TMOUT=300' >> .

Run tail command to check


if the variable has been
correctly added at the end of
.bashrc le. All subsequent
SSH connections will be
automatically closed after 5
minutes of inactivity from
now on.

$ tail .bashrc

In the below screenshot, the


remote SSH session from
drupal machine to Ubuntu
server via ubuntu_user
account has been timed out
and auto-logout after 5
minutes.
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 17/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Auto Disconnect SSH Sessions

Con gure Ubuntu


Firewall UFW
Every server needs a well
con gured rewall in order
to secure the system at
network level. Ubuntu server
uses UFW application to
manage the iptables rules
on the server.

Check the status of UFW


rewall application in
Ubuntu by issuing the below
commands.

$ sudo systemctl status


$ sudo ufw status

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 18/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Check UFW Firewall Status

Usually, the UFW rewall


daemon is up and running in
Ubuntu server, but the rules
are not applied by default.
Before enabling UFW rewall
policy in you system, rst
you should add a new rule to
allow SSH tra c to pass
through rewall via the
changed SSH port. The rule
can be added by executing
the below command.

$ sudo ufw allow 2345/t

After you’ve allowed SSH


tra c, you can enable and
check UFW rewall
application with the
following commands.

$ sudo ufw enable


$ sudo ufw status
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 19/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Open SSH Port and Verify

To add new rewall rules for


other network services
subsequently installed on
your server, such as HTTP
server, a mail server or other
network services, use the
below rewall commands
examples as guide.

$ sudo ufw allow http


$ sudo ufw allow proto

To list all rewall rules run


the below command.

$ sudo ufw status verbo

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 20/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Check UFW Firewall Rules

Set Ubuntu
Server Time
To control or query Ubuntu
server clock and other
related time settings,
execute timedatectl
command with no
argument.

In order to change your


server’s time zone settings,
rst execute timedatectl
command with list-
timezones argument to list
all available time zones and,
then, set the time zone of
your system as shown in the
below excerpt.

$ sudo timedatectl
$ sudo timedatectl list
$ sudo timedatectl set-

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 21/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Set Ubuntu Timezone

The new systemd-


timesyncd systemd daemon
client can be utilized in
Ubuntu in order to provide
an accurate time for your
server across network and
synchronize time with an
upper time peer server.

To apply this new feature of


Systemd, modify systemd-
timesyncd daemon
con guration le and add
the closest geographically
NTP servers to NTP
statement line, as shown in
the below le excerpt:

$ sudo nano /etc/system

Add following con guration


to timesyncd.conf le:

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 22/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99)
[Time] Get This Book   
NTP=0.pool.ntp.org 1.po
FallbackNTP=ntp.ubuntu.

NTP Time Con guration

To add your nearest


geographically NTP servers,
consult the NTP pool project
server list at the following
address:
http://www.pool.ntp.org/en/

Afterwards, restart the


Systemd timesync daemon
to re ect changes and check
daemon status by running
the below commands. After
restart, the daemon will
start to sync time with the
new ntp server peer.

$ sudo systemctl restar


$ sudo systemctl status

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 23/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

Start TimeSyncd Service

Disable and
Remove
Unneeded
Services in
Ubuntu
In order to get a list of all
TCP and UDP network
services up-and-running by
default in your Ubuntu
server, execute the ss or
netstat command.

$ sudo netstat -tulpn


OR
$ sudo ss -tulpn

List All Running Services

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 24/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

Staring RHCSA
RedHat with Ubuntu 16.10 Certi cation Exam Study Ebook ($39.99)
and RHCE Get This Book   
release, the default DNS
resolver is now controlled by
systemd-resolved service,
as revealed by the output of
netstat or ss commands.

You should also check the


systemd-resolved service
status by running the
following command.

$ sudo systemctl status

Check Systemd Resolved Status

The systemd-resolved
service binds on all enabled
network interfaces and
listens on ports 53 and 5355
TCP and UDP.

Running system-resolved
caching DNS daemon on a
production server can be
dangerous due to the
numerous number of DDOS
attacks performed by
malicious hackers against
unsecured DNS servers.
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 25/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

In orderRHCSA
RedHat to stop and
and RHCE
disableCerti cation Exam Study Ebook ($39.99) Get This Book   
this service, execute the
following commands.

$ sudo systemctl stop s


$ sudo systemctl disabl

Disable Systemd Resolved Service

Verify if the service has been


stopped and disabled by
issuing ss or netstat
command. The systemd-
resolved listening ports, 53
and 5355 TCP and UDP,
should not be listed in
netstat or ss command
output, as illustrated in the
below.

You should also reboot the


machine in order to
completely disable all
systemd-resolved daemon
services and restore the
default /etc/resolv.conf le.
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 26/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA
$ sudo and RHCE Certi cation Exam Study Ebook ($39.99)
ss -tulpn Get This Book   
$ sudo netstat -tulpn
$ sudo systemctl reboot

Verify All Running Services

Although, you’ve disabled


some unwanted networking
services to run in your
server, there are also other
services installed and
running in your system, such
as lxc process and snapd
service. These services can
be easily detected via ps,
top or pstree commands.

$ sudo ps aux
$ sudo top
$ sudo pstree

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 27/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

List Running Services in Tree Format

In case you’re not going to


use LXC container
virtualization in your server
or start installing software
packaged via Snap package
manager, you should
completely disable and
remove these services, by
issuing the below
commands.

$ sudo apt autoremove -


$ sudo apt autoremove -

That’s all! Now, Ubuntu


server is now prepared for
installing additional
software needed for custom
network services or
applications, such as
installing and con guring a
web server, a database
server, a le share service or
other speci c applications.
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 28/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   

If You Appreciate
What We Do Here On
TecMint, You Should
Consider:
1. Stay Connected to: Twitter |

Facebook | Google Plus

2. Subscribe to our email


updates: Sign Up Now

3. Get your own self-hosted

blog with a Free Domain at


($3.45/month).

4. Become a Supporter - Make


a contribution via PayPal

5. Support us by purchasing

our premium books in PDF


format.

6. Support us by taking our

online Linux courses

We are thankful for your never


ending support.

Tags: Ubuntu Initial Setup

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 29/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSAMatei
and Cezar
RHCE Certi
View cation Exam Study Ebook ($39.99)
all Posts Get This Book   

I'am a computer

addicted guy, a fan of open
source and linux based system
software, have about 4 years
experience with Linux
distributions desktop, servers
and bash scripting.

Your name can also be


listed here. Got a tip?
Submit it here to
become an TecMint
author.

PREVIOUS NEXT STORY


STORY The Linux
How to Lifetime 
 Enable, Mastery
Disable and Bundle Course
Install Yum
Plug-ins

 YOU MAY ALSO LIKE...

2 0 0

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 30/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

Pybackpac How to How to


RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
k (Python Install Install
Backpack) ionCube Kernel
Manager Loader in Headers in
tool for Debian and Ubuntu and
Ubuntu and Ubuntu Debian
Linux Mint 2 MAY, 2018 19 MAY, 2018
11 JAN, 2013

13 RESPONSES

 Comments 13  Pingbacks 0

tal  November 28, 2018 at 5:50 am


Thank you, very helpful. Just a question:
you mentioned “Staring with Ubuntu
16.10 release, the default DNS resolver
is now controlled by systemd-resolved
service” and then you stop and disabled
it.

So how the system resolve dns queries?


where can I nd which dns is in use?

Thanks
Reply

Ravi Saive
  November 28, 2018 at 10:15 am
@Tal,

Please read this line: “Running


system-resolved caching DNS
daemon on a production server
can be dangerous due to the
numerous number of DDOS
attacks performed by malicious
hackers against unsecured DNS
servers.”

So it’s depends on you whether


you want to active or not..
Reply
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 31/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

brent  July 10, 2018 at 10:02 am


RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
Ok having issues here following along
and everything goes ok until the “cat
/etc/hostname” = No such le or
directory, If I continue i can get the
public key generated but can not copy to
remote, it says no such le. I am
stopping here until I nd out what is
going on. Needing help.
Reply

Ravi Saive
  July 10, 2018 at 12:10 pm
@Brent,

Have you set your Ubuntu


hostname using following
command?
$ sudo hostnamectl set-hostname tecmint
Also what output you getting
when verifying hostname using
these commands?
$ hostname
$ hostname -s
How you copying the SSH key to
remote server? have you used
following command?
$ ssh-copy-id remote_user@remote_server
Reply

Brent Norris
 July 17, 2018 at 4:40 am
I will try this later this
evening but a couple of
questions on the $ssh-
copy-id
remote_user@remote_se
is the remote_server
supposed to be the ip
address of the remote
server or just
remote_server?

20I Funny
am newCommands
to the Linux.of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 32/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

Reply
RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
Ravi Saive
  July 17, 2018 at
11:25 am
@Brent,

Yes, copy the


SSH ID to
remote server,
means specify
the IP address
of the remote
Linux server.
Reply

Brent Norris
 July 18, 2018 at 11:31
am
Ok yes i have set the
host name as brentcpr-
server
$ hostname
$ hostname -s
output is brentcpr-
server.
When I to the ssh-copy-
id
remote_user@remote_se
it says ERROR: failed to
copy ID le
/home/bjn/.pub : No
such le to install the
contents of
/home/bjn/.pub anyway
look at the -f option.

Reply

Ravi Saive
  July 18, 2018 at
12:02 pm
@Brent,

It seems the
path is not of Linux or Linux is Fun in Terminal
20 Funny Commands
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 33/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

correct, if you
RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
could try again
generating SSH
Key Pair using
following
commands.
$ su - ubuntu_user
$ ssh-keygen -t RSA -b 2048
$ ssh-copy-id remote_user@remote_server
Reply

Brent
Norris
 July
19, 2018
at 2:38
am
Thank
you for
your
help, I
was
nally
able to
get
past
that
part, I
think,
not on
the part
that
says.
$ cat ~/.ssh/id_rsa.pub
It says
no such
le or
directory

Ravi
 Saive
 July
19, 2018
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 34/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

at 10:18
RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
am
@Brent,
That’s
really
great to
hear,
that you
solved
yourself

Brent
Norris
 July
19, 2018
at 3:09
am
Also
after
that,
$ sudo ufw status verbose
mine shows as
TO Action From
2345/tcp allow anywhere
80 allow anywhere
Anywhere allow 25,443/tcp
2345/tcp (v6) allow Anywhere (v6)
80 (v6) allow Anywhere (v6)
Anywhere (v6) allow 25,443/tcp (v6)
I have
went on
to
follow
the rest
of the
instructi
listed
and will
stop
here,
until I
can get
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 35/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

the
RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
other
problem
gured
out and
this
one.
Again
thanks
for any
and all
the
help.

Ravi
 Saive
 July
19, 2018
at 10:18
am
@Brent,

UFW is
in
active
state,
means
running
ne..

xABBAAA  October 27, 2017 at 7:45 pm


The very good thing, Thanks to the Great
stuff.
Reply

GOT SOMETHING TO SAY? JOIN THE


DISCUSSION.

Comment

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 36/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

RedHat RHCSA and RHCE Certi cation Exam Study Ebook ($39.99) Get This Book   
Name * Email *

Website

Notify me of followup comments via e-


mail. You can also subscribe without
commenting.

Post Comment

This site uses Akismet to reduce spam. Learn


how your comment data is processed.

LINUX MONITORING TOOLS LINUX INTERVIEW QUESTIONS OPEN SOURCE TOOLS

Install Glances, In uxDB and Shilpa Nair Shares Her 8 Best Video Editing
Grafana to Monitor CentOS Interview Experience on Softwares I Discovered for
7 RedHat Linux Package Linux
Management
How to Monitor User Activity 9 Best File Comparison and
with psacct or acct Tools 10 MySQL Database Difference (Diff) Tools for
Interview Questions for Linux
CloudStats.me – Monitors Beginners and
Your Linux Servers and Intermediates
20 Funny Commands of Linux or Linux is Fun in Terminal
https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 37/38
3/2/2019 Initial Ubuntu Server Setup for Beginners

Websites from the Cloud


RedHat RHCSA and RHCE Certi Nishita
cation Agarwal
Exam Study Ebook
8 Best Screen Recorders for
Shares Her ($39.99) Get This Book   
Desktop Screen Recording
Interview Experience on
Install Cacti (Network in Linux
Linux ‘iptables’ Firewall
Monitoring) on
RHEL/CentOS 7.x/6.x/5.x 3 Useful GUI and Terminal
11 Basic Linux Interview
and Fedora 24-12 Based Linux Disk Scanning
Questions and Answers
Tools
A Shell Script to Send Email
10 Useful Interview
Alert When Memory Gets 5 Most Frequently Used
Questions on Linux Services
Low Open Source Shells for Linux
and Daemons


Tecmint: Linux Howtos, Tutorials & Guides © 2019.
All Rights Reserved.     
The material in this site cannot be republished
either online or o ine, without our permission.

20 Funny Commands of Linux or Linux is Fun in Terminal


https://www.tecmint.com/initial-ubuntu-server-setup-guide/ 38/38

S-ar putea să vă placă și