Hello!

This content has been updated. You will be momentarily redirected to the current version.

Moved!



Moved! I now blog at http://www.saicharan.in



Showing posts with label RedHat9. Show all posts
Showing posts with label RedHat9. Show all posts

Wednesday, November 15, 2006

Linux : Mounting a USB device - made simpler

1) At the terminal, log in as root.

2) Open the /etc/fstab file for editing.

3) Append the following entry to the file: /dev/sda1 /mnt/usb autofs 0 0

4) Start > System Tools > Disk Management

5) Select the device to be mounted and mount.

NOTES:

1) /dev/sda1 is the name of the device whose file system you want to mount at /mnt/usb (this too is your choice!)

2) autofs tells the mount command that the filesystem type should (attempted to) be detected automatically. If you want, you can explicitly specify a file system.

3) In the options, DONOT specify the kudzu option. The kudzu option will cause /etc/fstab to be updated when the usb device is unmounted or unplugged. Thus, the entry will vanish after this. For more information regarding kudzu, use man kudzu at the terminal.

4) In the options, please specify user and NOT owner. If you donot specify user, the DiskManagement will not show the USB device if this is launched by a non-root user (by default). The GUI for DiskManagement is actually a command called usermount that reads from /etc/fstab and displays a list. Hence, if user is NOT specified, the device will not show up in the list. Further, the user option indicates that ANY user can mount this device!!!

5) For convinience, the DiskManagement can be added to the launcher panel (Start > System Tools. Right Click on DiskManagement and click on Add to Launcher Panel)

Changing the default command for RedHat8 Launch Panel

For accessing the Windows Network using Samba, only Nautilus seemed to be understanding the smb:// protocol. I did not want to each time start a terminal and type nautilus to start Nautilus. So, I wanted to add a launch panel icon. I could not find a way to add and configure a new icon. So I dragged the Help icon from the Main Menu and modified its Properties to run the command /usr/bin/nautilus. But this by default opened my home directory. I wanted it to open smb://Hostname. I had experimented earlier at the terminal and found that nautilus took as its command line arguements the location to be opened. So, I changed the command to /usr/bin/nautilus smb://Hostname. This worked well for me. But, I wanted some more sophistication. I wanted to log in directly since smb:// (like ftp://), takes the username and password separated by a colon followed by @ and the hostname. So, I changed the command to /usr/bin/nautilus smb://User Name:Password@Hostname. Nut, commandline did not parse the space separated user name (which Windows allows). So, as an additional change, using my instincts from my working with Linux, I enclosed the User Name within single quotes. This worked well. Similar strategy is also required to be used with the password if it contains spaces. Remember that while typing the username and password in the address bar of nautilus or at the Properties panel of the Launch Panel, the Password in NOT masked. So, it is at your risk that you do this.

So, all said and done, here is how the command looked at the end of the experimental session:

/usr/bin/nautilus smb://'User Name':'Pass word'@Hostname

Samba Server Setup

Check if the Samba server is installed: You can check this by going to Main Menu > System Settings > Server Settings > Services. Then, look for a service named smb. If it is present, that means, the Samba server is installed. If it is not started, start it up.

If you donot have the Samba server installed on your system, you should install it from the RedHat 9 CDs. The server along with the GUI to configure Samba are present on CDs 1, 2 & 3.
- Insert CD1.
- Go to the CDROM and navigate to RedHat > RPMS.
Here, look for a file called samba*.rpm. Install it.
- Insert CD2. Navigate to RedHat > RPMS.
Install a package called redhat-config-samba*.
- Insert CD3. Navigate to RedHat > RPMS.
Install a package called samba-swat*

NOTE: SWAT is a browser based configuration tool for Samba. It talks be default on port 901. So, to use this, httpd should be running on Linux and the firewall should not block this port.) We will use the GUI rather than SWAT for configuration.

  • Go to the command prompt and type: /usr/bin/redhat-config-samba (it is in /usr/bin folder).
  • Login as root.
  • You will get a screen similar to the one shown here.
  • Go to Preferences > Server Settings. The default settings are shown here. I had to keep the group to something different from what was the Workgroup on my Windows system. Give a nice description; this is what people from other systems will see as the title for the Server (eg. In Windows, in the My Network Places, Show Work Group Computer, this is what will be seen.)
  • On the Security tab,
- set the Authentication Mode to User.
- set the Encrypted Password to Yes.
- set Guest account to the user for whom you are setting up this share.
(I donot as yet know how to allow for anonymous shares...)
- click OK.
  • Go to Preferences > Samba Users.
- click add.
- Select the Unix username for the user whom you want to
permit to use the share. When he logs in, he will be takent to his home
directory unless some other shared folder has been specified.
- If the user is logging in from Windows, provide his Windows username

(this simplifies authentication and hepls to map Windows users to Linux users, I think so, I am not sure about this part).

- Provide a password (preferrably different from his Linux login password).
- click OK.
  • Click Add, and add a shared folder to allow access from outside the Linux machine.
  • To access this share from Windows, Go to My Network Places > View Workgroup Computers > Microsoft Windows Networks. Go to the appropriate workgroup that you had specified earlier. Here you will find the Samba Server with the description you provided earlier. Open this Samba and there you go!!!

Now someone please tell me how to access the Windows Shares from Linux. Any help would be appreciated. :)

UPDATE: Okay, just discovered that File & Printer Sharing must be enabled on Windows for accessing the Shared Files! For this, please run the Network Setup Wizard with appropriate options!!!