Archive for the tag 'server'

SBDavid

Install VNC in VPS server with Gnome

Install VNC in VPS server with Gnome

VNC, or Virtual Networked Computing, is a way of controlling a remote server just as though you are sitting in front of it. Like RDP remote desktop connection in Windows we have VNC for Linux. You can connect using a VNC client to a remote server system running the VNC server, then an image of the remote desktop is transmitted to your local computer and you can see and control the desktop.

Usually Linux servers are not installed with graphical interface(only text mode). However, for VNC to gain access of the user friendly interface like windows, Gnome or KDE have to be installed.

Note : Please make sure you have at least 128MB of unused ram to allocate for VNC. Also, YUM and its required libraries are installed (python, sqlite, etc) on the server.

Installation :

1. Login as root to your server and run the following:

yum -y groupinstall gnome (”yum -y groupinstall kde” for KDE )
yum -y install vnc vnc-server firefox x11-xorg

This will install Gnome and neccesary applications (VNC, FireFox, X11 libraries, etc) in the server.

2. Start up the vnc server with the ‘vncserver’ command and it will prompt you to enter a desired password. Just type what you want to use in and then confirm it. (if running as root, it will be in /.vnc or /root/.vnc or /home/root/.vnc)

3. Now, you’ll see VNC server is running by executing:

ps -ef |grep vncserver

Now kill the VNC processes,

pkill -9 vnc
rm -rf /tmp/.X1*

4. Edit xstartup file

vi /root/.vnc/ xstartup

Replace the last line(usually ‘twm & ‘ ) with ‘gnome-session & ‘ (without quotes of course). you can use ’startkde &’ for KDE

This tells VNC to startup GNOME instead of the default window manager, twm (or whatever the last line was).

5. Create users to VNCServer as follows,

Edit the lines below in the file /etc/sysconfig/vncservers and add a user (user should be a valid user created on your server and not just simply a name).

VNCSERVERS=”1:root”
VNCSERVERS=”2:newuser”

You can change the password of the VNCServer as :

vncpasswd homedir/.vnc/passwd

If you want to change the password for the VNC user root, run the following
command from konsole,

vncpasswd /root/.vnc/passwd

6. Go ahead and execute the command ‘vncserver’ again, and VNC will startup, using the password specified earlier and create a default VNC instance on VNC port 1.

7. Start up your RealVNC client on your PC, and put in :1, and it should ask for your password that you put in earlier.

SBDavid

Adding user/group in a FreeBSD server

Adding user/group in a FreeBSD server

How do I add a user and group to the FreeBSD Server?:

The ‘pw’ command can be used to add a user and or group to the FreeBSD System. The ‘pw’ command is a program that will allow any user with superuser privileges to edit and or add users and groups on FreeBSD with ease. It also allows a way to standardize modification of adding and removing users and groups.

pw groupadd anewgroup

This would create the group ‘anewgroup’ to the machine.

Now to add a users ‘ben’ to the ‘anewgroup’ using pw, issue the following command.

pw useradd ben -s /bin/csh -g anewgroup

This command would create the user ben, with a shell of /bin/csh and add it to the anewgroup group. The user would also have his home directory under /home/ben.

Now say, if the user needs to have the home directory on a different partition, for example /mnt/test/home issue the following command.

pw useradd ben -d /mnt/test/home/ben -s /bin/csh/ -g anewgroup

If the user ‘ben’ is to be added to a secondary group on the system, say a group that has been created already called ‘oldgroup’, then execute the following.

pw usermod ben -G oldgroup
SBDavid

Disable ping request to the server

Disable ping request to the server

Diable ping using the following type:

echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

or

As superuser, add the following lines to /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_echo_ignore_all = 1

Then run the following command to cause the change to take effect immediately:

sysctl -p

This change will persist following a reboot.

« Prev