Jeremys Linux Blog | don't take this blog for gospel. I'm a linux newbie!

TAG | Ubuntu

Instructions for accessing my Ubuntu Karmic Koala boxes remotely using three tools

PuTTY, WinSCP and VNC

VNC

VNC support is installed natively, it just needs to be configured. VNC is like Remote Assistance from Microsoft; you are able to remotely view and control Gnome and all open windows interactively. Of course there are a few limitations (such as applications relying on OpenGL). XBMC for example cannot be controlled via VNC.

1. From the Gnome System menu select preferences and then Remote Desktop

2. Configure according to your own security requirements. I wasn’t worried about limiting my exposure except for a password for inbound connections. Plus, I have a permimeter firewall; these boxes are not in a DMZ.

3. Install VNC viewer on the machine that you would like to connect from

http://lmgtfy.com/?q=vnc+viewer+free+download

4. Open VNC viewer on the machine you would like to connect from, insert the IP address of the remote machine and connect.

Tip: If Gnome Menus do not load, disable system effects (System, Preferences, Appearance)

PuTTY

First you need to install OpenSSH server on the remote machine

Put simply, PuTTY is software that allows you to run terminal commands/applications from a remote system. In other words, anything that is not GUI you can do remotely without VNC’ing to the box or logging into the physical box.

From Windows

1. Grab a copy of PuTTY; I prefer PuTTY portable

http://lmgtfy.com/?q=Putty+Portable

2. Open PuTTY.exe (or PuTTYportable.exe)

IP Address (or host) of server

Port 22

Username/Password

WinSCP

First you need to install OpenSSH server on the remote machine

According to the WinSCP website

“WinSCP is an open source SFTP client and FTP client for Windows. Its main function is the secure file transfer between a local and a remote computer. Beyond this, WinSCP offers basic file manager functionality. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol.”

Put simply, WinSCP is software that allows you to upload files to and download files from your Linux server.

From Windows

1. Grab a copy of WinSCP; I prefer WinSCP portable

http://lmgtfy.com/?q=WinSCP+Portable

2. Open WinSCP.exe (or WinSCPportable.exe)

IP Address (or host) of server

Port 22

Username/Password

, , , , , , , ,

Karmic Koala instructions for installing OpenSSH server to access Ubuntu remotely

1. I installed OpenSSH server

sudo apt-get install openssh-server

2. That’s it; because I only have two accounts with very secure passwords, I wasn’t worried about limiting my exposure in any way. Plus, I have a permimeter firewall; these boxes are not in a DMZ.

For details on accessing the boxes using WinSCP and PuTTY see here

, , , , , , ,

Karmic Koala instructions for installing notepad++ in Wine.

First you need to install Wine

1. Download the latest windows setup file from the notepadd++ website

http://lmgtfy.com/?q=notepad%2B%2B

2. Right click on the setup file and select run with Wine.

3. Complete the notepad++ setup wizard.

Do not install any additional options

Do not create any desktop shortcuts

4. From the Ubuntu menu browse to the notepad++ directory.

select Wine, Wine C:\ and browse to program files\notepad++

5. Copy the address from the address bar.

/home/jeremy/.wine/dosdevices/c:/Program Files/Notepad++/

6. Create a launcher on the desktop with the command.

wine “/home/jeremy/.wine/dosdevices/c:/Program Files/Notepad++/notepad++.exe”

, , , ,

Karmic Koala instructions for installing and configuring Samba on my Server

1. I installed Samba

sudo apt-get install samba samba-tools system-config-samba

2. I created a backup of the original Samba configuration

cd /etc

cd samba

sudo mv smb.conf  smb.conf.old

3. Create a new smb.conf

sudo nano /etc/samba/smb.conf

4. I typed the following config file thanks to help from http://samba.netfirms.com/index.htm

#Global parameters

workgroup = WORKGROUP
netbios name = server
encrypt passwords = yes

[homes]
read only = no
browseable = no

[backup]
path = /mnt/raid/backup
browseable = yes
write list = jeremy
invalid users = mediaservice

[downloaded]
path = /mnt/raid/downloaded
write list = jeremy
invalid users = mediaservice

[downloading]
path = /mnt/raid/downloading
browseable = yes
write list = jeremy
invalid users = mediaservice

[high def movies]
path = /mnt/raid/high def movies
browseable = yes
write list = jeremy

[movies]
path = /mnt/raid/movies
browseable = yes
write list = jeremy

[music]
path = /mnt/raid/music
browseable = yes
write list = jeremy

[music dvd]
path = /mnt/raid/music dvd
browseable = yes
write list = jeremy

[netsys]
path = /mnt/raid/netsys
browseable = yes
write list = jeremy
#invalid users = mediaservice

[scratch]
path = /mnt/raid/scratch
public = yes
browseable = yes

[software]
path = /mnt/raid/software
browseable = yes
write list = jeremy

[sysnet]
path = /mnt/raid/sysnet
browseable = yes
write list = jeremy
#invalid users = mediaservice

[tv]
path = /mnt/raid/tv
browseable = yes
write list = jeremy

[watch]
path = /mnt/raid/watch
browseable = yes
write list = jeremy
invalid users = mediaservice

[wing chun]
path = /mnt/raid/wing chun
browseable = yes
write list = jeremy

5. I created a new user account called mediaservice (as mentioned above)

sudo useradd -d /home/mediaservice -s /bin/false -N mediaservice

sudo passwd mediaservice

*************

*************

sudo smbpasswd -a mediaservice

*************

*************

6. I set a samba password for my own account

sudo smbpasswd -a Jeremy

*************

*************

5. I restarted samba

sudo /etc/init.d/samba restart

5. I set permissions on the files

sudo nautilus

via nautilus I navigated to /mnt/raid and right clicked and selected permissions

Owner -> Root, Create and Delete Files

Group -> Users, Create and Delete Files

Others -> Create and Delete Files

5. I tested from a windows workstation

\\192.168.0.200

, , ,

Karmic Koala instructions for reassembling my RAID 5 software array on my Server after reinstalling the OS

I didn’t learn to do this by choice! I mucked up my video configuraiton and couldn’t boot into the gnome… after spending about 4 or 5 hours trying to fix it; I “bit the bullet” and reinstalled ubuntu.

1. I installed mdadm

sudo apt-get install mdadm

2. I (re) assembled the array

sudo mdadm –assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

3. I got the details of the array

sudo mdadm –detail –scan

Output on this occasion was as follows; do not copy and paste this directly – it will be a different UUID for future arrays I create

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=00.90 UUID=58155936:66553965:01f9e43d:ac30fbff

I found out later that I needed to remove one of the zeroes from the metadata version… when I did a sudo mdadm -D it gave me an error for the version information.

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

4. I copied and pasted the above line into mdadm.conf

sudo nano /etc/mdadm.conf

File now has the following entry:

# definitions of existing MD arrays

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

5. I created somewhere for the array to be mounted

cd /mnt

sudo mkdir raid

6. I wanted the drive to be mounted automaticaly on startup

sudo nano /etc/fstab

7. I added the following line

/dev/md0                /mnt/raid                ext3                defaults                0                0

8. I mounted all arrays without rebooting

sudo mount -a

, , , , , , ,

Karmic Koala instructions for creating the RAID 5 Software array on my Server

Originaly found here http://www.jamierf.co.uk/2009/11/04/software-raid-5-using-mdadm-in-ubuntu-9-10/ but stored on my blog for reference incase their blog dies one day.

1. I installed mdadm

sudo apt-get install mdadm

2. I listed all the drives

sudo fdisk -l

3. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively

sudo fdisk /dev/sda (but I also did this for the other drives in the array) /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf

4. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively so obviously I didn’t touch them

n (for new drive)

p (for primary partition

1 (for partition 1)

enter (to select first cylinder

enter (to select last cylinder)

t (to set disk type)

1 (for partition 1)

fd (for Linux Raid Autodetect)

w (to write changes to disk)

5. I created the array

sudo mdadm –create –verbose /dev/md0 –level=5 –raid-devices=6 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

6. I watched the progress

sudo mdadm -D /dev/md0

7. I got the details of the array

sudo mdadm –detail –scan

Output on this occasion was as follows; do not copy and paste this directly – it will be a different UUID for future arrays I create

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=00.90 UUID=58155936:66553965:01f9e43d:ac30fbff

found out later that I needed to remove one of the zeroes from the metadata version… when I did a sudo mdadm -D it gave me an error for the version information.

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

8. I copied and pasted the above line into mdadm.conf

sudo nano /etc/mdadm.conf

File now has the following entry:

# definitions of existing MD arrays

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

9. I created the file system

sudo mkfs.ext3 /dev/md0

10. I removed the default 5% reserved space from the drive

sudo tune2fs -m 0 /dev/md0

11. I created somewhere for the array to be mounted

cd /mnt

sudo mkdir raid

12. I wanted the drive to be mounted automaticaly on startup

sudo nano /etc/fstab

13. I added the following line

/dev/md0                /mnt/raid                ext3                defaults                0                0

14. I mounted all arrays without rebooting

sudo mount -a

sudo fdisk -l

, , , ,

Find it!

Theme Design by devolux.org