Archive for the 'tips' Category Page 2 of 23



Mount remote filesystem via ssh protocol using sshfs and fuse [Fedora/RedHat/Debian/Ubuntu way]

sshfs

Imagine the following situation: you have to compile some Linux/Unix application or kernel module that requires kernel source present at your hard drive, say, in /usr/src/kernels/kernel-2.6.21-i386/ or elsewhere. But there is not enough disk space to copy these sources or install kernel-devel or linux-source packages (in Fedora/RedHat or Ubuntu/Debian distros respectively)… Sounds familiar? Believe me, sometimes it happens :)

As a solution you can mount the directory of some remote PC that contains needed kernel source. It can be done via several protocols like smb, ftp etc. In this article we will mount remote directory using ssh protocol that is one the most popular for remote and secure access to Linux boxes over the network.

Below are the steps which should be taken to get the ball rolling. We need two packages: sshfs and fuse-utils.

ssh1. Install necessary packages:

a. Ubuntu/Debian:

sudo aptitude install fuse-utils sshfs

b. Fedora/Centos/RedHat:

yum install fuse-sshfs fuse fuse-libs

c. Other Linux: download and compile sshfs/fuse from sources

2. Check that kernel module fuse is loaded:

lsmod | grep fuse

There should be the line containing “fuse” in the output (of not try modprobe fuse).

3. Mount remote filesystem using something like this (two commands):

mkdir -p /mnt/sshfs/
sshfs remote-user@remote-machine:/some/directory /mnt/sshfs

where remote-user is the username allowed to login remote-machine via ssh protocol. It will ask you to type the password so just type it and press return :)

4. That’s it. Good luck!

Ubuntu Iptables Firewall: set of useful links

Ubuntu as any other Linux distribution comes with netfilter iptables as default firewall. This is one of the best firewall software for Unix family operating systems: it allows to perform various filtering operations and makes it possible to match packets using numerous ways starting from data in IP packet header and ending with Layer 7 packet inspection (but this is another topic).

Below you can find a list of articles on the Web helping to understand the logic of Ubuntu iptables setup as well as create powerful firewall from your Ubuntu system:

1. Official Ubuntu Iptables How To:

There is a wealth of information available about iptables, but much of it is fairly complex, and if you want to do a few basic things, this How To is for you.

2. Simple firewall for Ubuntu using iptables

Don’t forget to look through page’s comments as there is a lot of useful staff there.

3. Setting Up An Iptables Firewall On Ubuntu With Firehol from Howtoforge:

FireHOL is a stateful iptables packet filtering firewall configurator. It is abstracted, extensible, easy and powerful. It can handle any kind of firewall, but most importantly, it gives you the means to configure it, the same way you think of it.

4. Basic sshd and iptables security in Ubuntu

5. Use iptables as firewall with a daemon on system startup

This howto is intended to set up a firewall without installing firestarter (useful if you don’t use any wm, eg: servers). It uses iptables which is available with a fresh Ubuntu install, and a init.d script to run it as a daemon on boot.

6. Set up Ubuntu as a firewall/gateway router with webmin

7. Netfilter & Iptables in Ubuntu (French)

8. Set a custom firewall (iptables) and Tips [Beginners edition]

9. Set a custom firewall (iptables) and Tips [Advanced user only]

10. iptables premier

“Do I need a firewall?” is a FAQ on the Ubuntu Forums. In order to answer that question we need to understand what you want to do accomplish by using (configuring) a firewall. The purpose of this post is to introduce iptables and encourage appropriate use.

11. Block brute force attacks with iptables in Ubuntu or Turning away the bruters

Without proper protection your server is a sitting duck waiting for a bot to guess the right combination and hit the jackpot. But with just 2 commands we can stop that.

Of course you can try google to find more articles about how to configure iptables in Ubuntu Linux but I am sure that above mentioned links will help you to move forward with configuring Ubuntu iptable and take the first steps on builing secure and stable iptables firewall box.

VMware server console keyboard problem in Ubuntu Intrepid Ibex

Few days ago I have upgraded my Ubuntu to latest 8.10 (Intrepid Ibex) and found that keyboard just doesn’t work in VMware Server Console. The problem was that I couldn’t use keyboard under guest operating system including Windows, Linux etc. After few hours of research I found simple solution which works for me:

$ setxkbmap
$ echo "xkeymap.nokeycodeMap = true" >> ~/.vmware/config

After this restart vmware-server-console and see if it helps. If not you can see other solutions of the same problem at this site:
http://nthrbldyblg.blogspot.com/2008/06/vmware-and-fubar-keyboard-effect.html

I hope it helps!
Continue reading…

Open .docx documents in Linux (OpenOffice)

Well, as for now it is not a problem anymore to open Microsoft Office 2007 .docx documents in any Linux distribution coming with OpenOffice suit. It may be Ubuntu (Feisty, Gutsy, Interpid whatever), almost any version of Fedora/RedHat/Centos, *SUSE, Mandriva and of course Debian (as per my personal opinion it’s the best one).

What is .docx actually? It’s Microsoft’s file format representing word processor documents and named OpenXML (as an attempt to create open and free international standard). Today .docx is default format for Microsoft’s word processor Word.

There are myriads of online converters between OpenXML and OpenOffice formats including .docx, .xlsx, .odt and many etc but sometimes it’s much more better to just open received .docx file in Linux offline (if there is temporarily no Internet connection or for security/private reasons etc).

So, just download the following package to certain directory like /usr/src, here are the commands to do it:

1. cd /usr/src
2. sudo wget http://blog.mypapit.net/imej/odf_filter.tar.bz2

The next step is to unpack the contents of the archive (.tar.bz2 is definitely well compressed file) and copy 3 files to OpenOffice’s system directories:

3. sudo tar -xvjf odf_filter.tar.bz2
4. sudo cp OdfConverter /usr/lib/openoffice/program/

5. sudo cp MOOXTypeDetection.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Types/
6. sudo cp MOOXFilter_cpp.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Filter/

As you can see from picture below now it’s possible to natively open .docx files in openoffice under Linux. Of course such “native” support may imply some artefacts in opened files due to file formats incompatibility so it’s also a good option to ask your friends to convert .docs into .pdf before sending you :)

openoffice openxml .docx

P.S. Thanks to guys from mypapit.

P.S. Here are several online converters .doc(x) <-> .odf <-> .pdf:

1. ZAMZAR (possibly the best converter), 2. http://docx-converter.com/.

Find location of the program in Ubuntu

It’s rather trivial task for people who use Ubuntu for a long time but newbies usually have problems with adding program to startup if location of the program is unknown or it is required to specify full path to the program somewhere e.g. when opening attachment in mail client. There are two most popular ways to find this out:

1. which gedit
2. type gedit

Both will show full path to certain program (gnome editor in our example): /usr/bin/gedit:

commands: which and type to locate the programs in Ubuntu




Pages: Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Next
Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››