Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running RH 8.0. Am trying to create a simple alias to allow me to mount my usb floppy drive (which is normally mountable, when I'm logged on as root, via "mount -t auto /dev/sda /mnt/usb/"). So I put an alias line in .bashrc as follows:
alias mountusb='mount -t auto /dev/sda /mnt/usb/'.
Once I log back on and type "mountusb" I get "Only root can do that." So when I log on as root and type in "mountusb" I get "command not found." How can I correct this?
and just to explain your problem, you are adding that alias to your normal users .bashrc, the root has this same file in the home (/root) directory also....so the reason why it said command not found is because what you added to your normal users .bashrc wasn't added to you roots .bashrc..
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Rep:
Well yeah you could make an alias but then you would need to create an Sbit for the alias that root has created. i.e. chmod 4555 /bin/mount and make sure that the alias is in everyone's path. What would make more sense would be to edit the /etc/fstab:
/dev/sda mountpoint auto defaults,noauto,owner 0 0
then when you want to mount the drive:
$mount mountpoint
On another note, I believe that mount available to users if it is available in the fstab or they have permissions to the mount command.
It sounds like your getting command not found because you edited in /root/.bashrc instead of /home/user/.bashrc You could resolve this by editing the /etc/skel/.bashrc and creating the new accounts
Tinkster and KDE4me, if I edit fstab, will my changes still be **in** that file after I reboot the machine, or will I need to modify fstab each time I log on? I have modified fstab in other ways recently and it seems to me that my changes disappeared upon rebooting.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.