1

Home Fedora Server Setup

Did you ever wonder if you could remotely download, upload or control your Fedora (or any other Linux distribution) machine remotely? If the answer is yes, keep on reading because we will do just that!

In this article, we will use a user called User on a machine called machine, simple enough?

Adding User to sudoers

For added security, we will avoid working with the root user. Therefore, we need a user capable of executing administrative commands. To do that, we’ll just add User to the sudoers

[User@machine ~]$ su -
[Root@machine ~]# visudo

Add the following line at the end of the file

User ALL=(ALL) ALL 

or to sudo without password prompt (not recommended)

User ALL=(ALL) NOPASSWD: ALL

That’s it, we can now use sudo to execute administrative commands!

VNC Server

For remote desktop access, we will use the VNC server for it’s cross platform abilities. Note: VNC connections are not encrypted so don’t use it on public networks.

[User@machine ~]$ sudo yum install vnc-server vnc
[User@machine ~]$ sudo vi /etc/sysconfig/vncservers

Edit the file so it contains:

VNCSERVERS="1:User"
VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"

Set the vnc password for the user (this should be different than the password for the local/ssh login):

[User@machine ~]$ vncpasswd

Set the services:

[User@machine ~]$ sudo service vncserver restart
[User@machine ~]$ sudo chkconfig vncserver on

FTP Server

If you want to access your files remotely and transfer them to other machines, you’ll need to install an FTP server

 [User@machine ~]$ sudo yum install vsftpd
[User@machine ~]$ sudo chkconfig vsftpd on
[User@machine ~]$ sudo vi /etc/vsftpd/vsftpd.conf

change from

anonymous_enable=YES

to

anonymous_enable=NO

uncomment both lines bellow

write_enable=YES
local_enable=YES

Set the services:

[User@machine ~]$ sudo service vsftpd restart

SSH

Finally, to administer your server through the console remotely, you need ssh

[User@machine ~]$ sudo yum install ssh-server
[User@machine ~]$ sudo service sshd start
[User@machine ~]$ sudo chkconfig sshd on

Lets secure the server:

[User@machine ~]$ sudo vi /etc/ssh/sshd_config

Add the following lines at the end of the file:

LoginGraceTime 30

(or if you’re paranoid, use 15. This is the amount of time you have to login)

PermitRootLogin no
AllowUsers User

Now restart the service and you are done

[User@machine ~]$ sudo service sshd restart

End note

Obviously, you’ll need to set up your server to let those services through. Keep in mind that VNC runs on port 590x where x is the number in the

VNCSERVERS="1:User"

line. Also, here’s a little bonus; how to encrypt your VNC sessions: just run (in the terminal):

ssh -f -L 25901:127.0.0.1:5901 User@ip -p 22 sleep 10; vncviewer 127.0.0.1:25901:1

Hope you liked the tutorial! Questions, as usual in the comments and I will do my best to answer them. Stay tuned, I have more tutorials coming in the next few weeks!

Comments

One Response to “Home Fedora Server Setup”
  1. exn says:

    Hey! Try freenx server instead of the vnc ;)
    I’m much more flexible, easy and secure.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

© Copyright Talkcomputer.net | theme by mr-wordpress