Linux.com

Home Linux Community Community Blogs

Community Blogs



Using SSHFS to remote mount a Windows System.

Try hard as we might, it's impossible to get away from the OS from Redmond.  All too often we need to be able to get a file off or onto a Windows system in a secure manor.  Samba won't work over the Internet, NFS isn't an option either over the internet.  Linux to the rescue, along with some FOSS for Windows. 

FUSE or File sytem in USEr space, allows Linux to create file systems of multiple kinds that can be mounted and manipulated by an unpriviledged user, meaning no root privileges are needed at any time.  SSHFS or SSH File System, is the type of file system we will use. Other Windows connectable file systems exist but since we are going over the open Internet and we want data integrity, and security I've chosen SSHFS for this.  I've tested it on win2k XP and 2003 server so far without a problem.

Step one: go to  http://sshwindows.sourceforge.net/download/ and grab the binary installation file for Windows. (Currently i386 version only) Install this on the Windows system you wish to mount from a remote location.  The process on how to install an application on Windows and create Users is an exercise I'll leave to the reader.  However to someone who is familiar at all with SSH running the install and answering it's questions should be straight forward.  NOTE: If you have cygwin installed you should install the SSH server with cygwins package manager as it will be less likely to cause a conflict. At this point, from your Linux box ssh into the windows box and make sure it all works.  Once it does.  You are done with the windows work.

 Step two:  If you are running RHEL/CentOS 5.x  the modules you need will already be installed in the running kernel, and the packages will be available in the normal repository.  RHEL/CentOS 4.x will require that you use either DAG's repository or do the normal configure/make/make install routine.  I highly recommend DAG's work as it's always rock solid, and his packages are correctly integrated into RH/CentOS system so as to not cause future conflicts.  Ubuntu and Deb (sarge and Lenny) both have FUSE available in the apt repository and the dependency will be brought in when you install SSHFS.  

Step three:  Install SSHFS With RHEL/CentOS you will need DAG's repository setup.  Then just yum install fuse-sshfs, or Ubuntu/Debian do apt-get sshfs.  All dependency's will be pulled.  The following should be taken care of before you begin.  Edit /etc/group (I use vigr) and add all users who you want to be able to use SSHFS into the group fuse.  Once this is done we are ready to test things out.

Now we get to mount our remote windows system.  Create a dir in your home directory to mount the remote system and then prepare to do a simple test run. 

 usage: sshfs [user@]host:[dir] mountpoint [options] 

 Is the proper format for running the command, and remember that if you skip the [user@] portion, just as in Linux it will assume that your current logged in user is the username to use on your remote server as well.  

 #> sshfs myname@mywinbox: /myhome/mountpoint  

This will grab the user home or C: (depending on System) mount it locally and give you access to read/write these files as if they were locally held.  Also at the same time any user on the Windows box will also be able to read/write the same file (no file locking is provided. ) so it's best to co-ordinate with the user on the other end if needed.  

At this point the movement of files will be at the same speed as a normal ssh, man sshfs can be read and used to fine tune the sshfs mount the most important from my viewpoint is the ability to set the UID and GID of the files so that the correct user has access to them.  Again since this isn't a comprehensive tutorial, I'll leave it to the reader to learn from the man page. 

 

Latest software experiments.

Am trying a new software called product snapshot in virtuemart. It allows you to embed the picture of a product within your Joomla article.
 

U.S. Army upgrades PCs to ... Windows Vista?

A first news, what I read today, about ...

I thinked, what U.S is use on yours PC - Linux,MS and other systems. But it.s

not that.

Read more... Comment (0)
 

Star Wars anthem & pc speaker

 Imperial march through the speaker (using beep utility):
 
Read more... Comment (1)
 

Der Windowsuser auf Linux.com

Hi!

Ich bin hier wohl ein blinder Passagier, ich logge mich per Windows in meinem Linux Account ein. Das hat wohl den Grund, dass es sehr mühsam ist, mit Programmen wie "Adobe AfterEffects" die man für die Schule benötigt arbeiten zu wollen und nebenbei seinem Hobby, und zwar "Die tollen Errungenschaften der Linuxcommunity erforschen" nachzugehen versucht.

Nunja, irgendwie stellt sich nach der Erläuterung  für mich die Frage, ist die Linuxcommunity jetzt bemüht ein OS bzw eine Distribution an freien Programmen zu schaffen mit denen der Normalo-Heimanwender auch mehr als im Internet surfen, Emails checken, Officeanwenudungen bedienen und Minigames spielen kann?

Okey, das hört sich jetzt bestimmt etwas zünisch an. Aber im ernst, es gibt haufenweise Projekte wo es um die Bedienung des OS  geht (KDE, Gnome und alle Miniprogramme die mit den Oberflächen harmonisieren, haufenweise Kommandozeilentools)  außerdem gibt es Serversoftware, Musikplayer, Videoplayer, Minigames, Editoren, etc ... aber ... Was macht der Standard-PC-Freizeituser wirklich?

Mal checken wieviel linuxkompatible Software für bestimmte Bereiche vorhanden ist:

Officeanwendungen

Es gibt Open Office und auchein paar andere Softwarepaket. Open Office halte ich aber bereits für vollkommen ausreichend und kann für mich zb MS Office vollkommen ersetzen.

Musik hören

 Okey, da gibts einige Softwarepakete.
Amarok zb. Für Gnome gibts auch haufenweise(Rhythmbox) .
Auch die organisation der eigenen Musikdatenbank kommt mit gewissen Tagging-programmen nicht zu kurz.

Videos ansehen

Da gibts auch keine probleme

 

NEWB's adventure's in Linux From Scratch

  Back again,

     I find myself at a point now where there are many ways of doing things with the command line, it's a bit daunting to say the least. Study, study, study, remember that Auther of the book said read any manuals three times before you'll understand it. If it takes you more than three times there's something else you should be reading first.

  I'm finding myself taking side trips as I journey down my path to LFS install. I was at my local pub the other night and my friend was looking for a security system for his business so he could keep an eye on the place when he's at home. Enter "Zoneminder" downloaded the "bluecherry livecd " and have a few old pc's around so ...... ummm

  Now I must say I help a lot of my Windows friends with installs and hardware issues on their machines. So I get asked alot of questions.. Another friend cornered me at his house and asked about a media extender... I told him give me a few days.. Enter NASLite-M2...to serve windows media player format and linksys has an inexpensive extender with dvd player for less than 150 bucks. My point is... I'm addicted to Linux :) I don't even have to really know what I'm doing seems like everytime I think of something I'd like to do with computers all I have to do is "Google + Linux" and someone's already done it or is currently developing it :)

  Note: I haven't been able to get a ton of reading done , with my main computer broken and my friends needing my help with their computers ... you know how it goes :)

 

Checking for and Killing Zombie Processes

Zombie processes are processes that are no longer in use by their parent, yet the parent hasn't properly killed the process yet.   Zombie processes aren't necessarily bad, but a high number of them can be. Don't feel that you must automatically kill all zombie processes because they'll just come back. Just kill them after many (maybe > 50) have accumulated.

 These should work with pretty much any OS.  I've tested these in Ubuntu and CentOS

Checking for Zombies

ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]'

Automatically kill all zombie processes

sudo kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`
 

CentOS 4.7: Upgrading autofs4 to autofs5

This article contains the procedure for upgrading autofs4 clients to autofs5. One good reason to do this is because autofs5 is a complete rewrite and it better handles lazy umounting and v5 actually respects the /etc/nsswitch.conf priorities, whereas v4 didn't. You will also find that v5 has better support for "+" entries in local maps. If you're running into issues where autofs won't load certain mount points at all, an upgrade to v5 might be in order. 

These instructions were used for CentOS 4.7, but should apply to all versions of CentOS

$ cd /
$ sudo service autofs stop
$ sudo chkconfig autofs off
$ sudo yum -y install autofs5
$ sudo chkconfig autofs5 on
$ sudo service autofs5 start
 

Making my own Desktop Manager: Getting Started

Ok so I have a LOT of work ahead of me - I know this! I am also trying to do this whilst juggling a full-time job, a band, and time with my family, so it isn't going to get done over-night (let's hope my short attention span doesn't get the better of me!)

The goals I wish to accomplish with my Windows/Desktop manager are:

 

  1. A beautiful, simple, and FREE environment
  2. Extremely lightweight
  3. Customizable through BSD-style .rc & .conf files
  4. Tiling Window Manager with a few layout algorithms (with little or no window decorators)
  5. Optional Composite layout (allows for transparency and shadows)
  6. Easy to install (initially targeted for ArchLinux, but will eventually run on Ubuntu and may be others?)
  7. Have an integrated version of WebKit (possible via WebKitGtk?)
  8. Integrate Social features into the Manager such as GmailTwitter and IM (via Pidgin's libpurple?)

 

Here are what I believe my first steps are:

 

  • Create a Design document and stick to it!
  • Finish reading my X11/XLib book
  • Read the relevant info from the FreeDesktop.org site
  • Look though DWM (and possibly other Window Managers) source code
  • Decide whether to make it OpenGL based or Cairo (or multi/others?)

 

Any suggestions from anyone out there would be mostly appreciated!

I intend to release all the code via either a GPL or MIT/BSD licence on GitHub.

Here we go.... 

 

Program Recommendation: Clonezilla

For anyone that hasn't seen it, I highly recommend a project called Clonezilla for system backup.  Clonezilla is useful right before an upgrade because it can capture the entire state of a hard drive (think dd, but easier to use) and possibly restore it at a later date.  Obviously with this kind of "image" backup, you can't cherry-pick files to restore from it--it's either all or nothing, but the option is particularly good right before upgrades to give you a point to return to if the upgrade fails.

 I recommend using Clonezilla in configurations where you have a separate /home folder that's backed up using your normal user-space backup program, and then periodically using Clonezilla to clone your bootable partitions.

 Hopefully that helps some folks out.

 

NEWB's adventure's in Linux From Scratch

  Hello again,

   Today I'm going over my amd64 dual box and just realized why I may have gotten some compile errors.... booting up in dmesg I was getting errors that there's a firmware bug in my bios and my cdrom is not operating properly. I seem to remember that anyone using Linux really should check their hardware to make sure of complete compatibility. Something that will make my next attempt at building the LFS a bit easier I should hope.  I've decided my future attempts will be on a pentium4 machine with a single processor.

I'm in the hopes that this action will remove another roadblock to my sucessful building of LFS

 
Page 119 of 147

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    05 Jan » 09 Jan - Virtual
    Details
  2. LFS220 Linux System Administration
    05 Jan » 08 Jan - Virtual
    Details
  3. LFD331 Developing Linux Device Drivers
    12 Jan » 16 Jan - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board