LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-27-2006, 03:31 PM   #1
noobtastic
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
What drive am I on?


Hullo penguins,

Its been a few years since I touched linux, now I'm back on it with RHEL 4. I have two questions if you please!

1) I am logged in as root. I have four hard drives. But how do I determine which drive all the main files are on?

Code:
root@host [/home]# cd /
root@host [/]# ls
./            .autofsck       boot/   etc/      hdd3/    lib/         misc/  portsentry-1.1-5.i386.rpm  root/     selinux/  tmp/
../           auto-whitelist  dev/    .forward  home/    lost+found/  mnt/   proc/                      sbin/     srv/      usr/
aquota.user*  bin/            disk1/  hdd2/     initrd/  media/       opt/   quota.user*                scripts/  sys/      var/
root@host [/]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1            478655540   2888788 451452380   1% /
none                   1036932         0   1036932   0% /dev/shm
/dev/sdb1            480719056    106572 456193284   1% /disk1
/dev/sdc1            480719056    106572 456193284   1% /hdd2
/dev/sdd1            480719056    106572 456193284   1% /hdd3
/usr/tmpDSK             495844     10564    459680   3% /tmp
/tmp                    495844     10564    459680   3% /var/tmp
root@host [/]#

And secondly. I have created a user. And this user has absolutely no permission to do anything. Now I think this may have something to do with assigning the user to a group that has +x permission on each service I am trying to run?

I mean for example, even SU does not work.
Code:
vsftpd@host [/]# su root
bash: /bin/su: Permission denied
Please help!
 
Old 05-27-2006, 03:46 PM   #2
pansarevaibhav
Member
 
Registered: Oct 2005
Location: mumbai
Posts: 34

Rep: Reputation: 15
hi,
put the following command
df -h
it will show u which partition is on which hdd
if it is /dev/hda then its primary master and likewise
about adding a user check the user entry in /etc/passwd file what is uid and gid
for time being to make it root user u can change uid of user to 0 so it will have all access .
to add in roots group use
adduser -g username group
thanks
 
Old 05-27-2006, 03:53 PM   #3
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Look at your /etc/fstab file to see the drive and partition location of the ones linux is using.

Also just do ' su ' or ' su - '. su is root with the previous users enviroment variables. su - is root using root's enviroment variables.

Brian1
 
Old 05-27-2006, 03:56 PM   #4
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Quote:
Originally Posted by noobtastic
1) I am logged in as root. I have four hard drives. But how do I determine which drive all the main files are on?
Well I would probably say /dev/sda1 as that is mounted as /, and the "main files", which I would determine to be apps, and configuration, are most likely going to be in /usr and /etc, which since they are not looking to be anything else mounted are probably there.

However, there is a potential that one of those is symlinked to /disk1, /hdd2 or /hdd3, but I would imagine that many apps would not play ball with a symbolic linked /usr or /etc so it is probably a very safe bet that they are on /dev/sda1. This could be quickly asserted with an "ls -l".

You do know you can use "df -h" to get a human friendly version in 2Dp units like Kb, Mb and Gb.

Quote:
And secondly. I have created a user. And this user has absolutely no permission to do anything. Now I think this may have something to do with assigning the user to a group that has +x permission on each service I am trying to run?
Actually su is probably not the best test for execute priveliges as a "normal" user may not be allowed to run su. A more simple app to test would be "env".

What groups are the user in? How did you create the user?

Danny
 
Old 05-27-2006, 04:15 PM   #5
noobtastic
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for all your replies!

Brian the contents of /etc/fstab reads:

Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults,usrquota        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/disk1            /disk1                  ext3    defaults,usrquota        1 2
LABEL=/hdd2             /hdd2                   ext3    defaults,usrquota        1 2
LABEL=/hdd3             /hdd3                   ext3    defaults,usrquota        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
LABEL=SWAP-sda2         swap                    swap    pri=0,defaults        0 0
pansarevaibhav I typed df -h and this is the output:

Code:
root@host [/]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             457G  2.8G  431G   1% /
none                 1013M     0 1013M   0% /dev/shm
/dev/sdb1             459G  105M  436G   1% /disk1
/dev/sdc1             459G  105M  436G   1% /hdd2
/dev/sdd1             459G  105M  436G   1% /hdd3
/usr/tmpDSK           485M   11M  449M   3% /tmp
/tmp                  485M   11M  449M   3% /var/tmp
root@host [/]#
So... I am presuming that /dev/sda1 is the drive I am on, as the others seem to have no sizeable data differential in comparison to sda1.

Q1) What is the 'none' drive? Is this normal?

As suggested I also look in to /etc/passwd and this is what it says for VSFTPD:
Code:
vsftpd:x:32003:32003::/home/vsftpd:/bin/bash
Q2) I do not wish to give the user root privelege. I wish to 'If possbile!' assign which commands the user may execute. Or, as to which folders the user may execute/write etc within. Is there a simple command for this?

Thanks to all who took the time to reply, I appreciate it.
 
Old 05-27-2006, 04:22 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Forgot the redhat scheme of /etc/fstab. You need to look at /etc/mtab to see what /dev the LABEL equeals to in /etc/fstab.

Misread the section on su in post.
If you wish to allow a user a few root commands then you can either setup /etc/sudoers file using the visudo tool to edit.

Brian1
 
Old 05-27-2006, 04:32 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
The vfstpd user is a system user and not a regular user. Create a real regular user account to use.

The "none" in /etc/fstab is normal for "shm" and "proc" and other pseudo filesystems.
 
Old 05-27-2006, 04:37 PM   #8
noobtastic
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
The vfstpd user is a system user and not a regular user. Create a real regular user account to use.
Thanks for your reply. Im not sure the difference between creating a system and regular user. I used this:

Code:
adduser fsftpd
passwd fsftpd
etc. can you detail what the difference is in command terms? Sorry!
 
Old 05-27-2006, 09:45 PM   #9
sdexp
Member
 
Registered: Sep 2003
Location: USA
Distribution: Ubuntu Linux
Posts: 103

Rep: Reputation: 15
System users don't have home directories like regular users, and they have awkward names.

You should make sure even the system users are placed in the group of regular users so, so the system users can use commands such as su.
 
Old 05-28-2006, 05:28 AM   #10
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Quote:
Originally Posted by noobtastic
Q2) I do not wish to give the user root privelege. I wish to 'If possbile!' assign which commands the user may execute. Or, as to which folders the user may execute/write etc within. Is there a simple command for this?
If you want to selectively control who can run what, your best bet is to use groups.
This work swell if you have a whole bunch of commands you only want some users, but not all to run. First, group up the commands by who needs to use them, for example if commands a,b and c should be usable by some users, and commands d, e and f by some others, you have two groups there. Then create groups for these on your system (with a suitable name like "accessabc").

You then change the group ownership of the commands in question (you can find their actual dir location with "which" followed by the command name) to the new group, and unset the everybody execute flag:

(Example for the command su)
Code:
$ which su
/usr/sbin/su
$ chgrp sugroup /usr/sbin/su
$ chmod o-x /usr/bin/su
Then you ensure that the item has got the group execute flag:
Code:
$ chmod g+x /usr/bin/su
And then add the users you want to run it to the group (as a secondary group), which can be done by simply adding the user to the list of groups following the last colon in the /etc/group file.
Users not in that group will then not be able to execute the command. However, if the command is a perl, or shell script, they may be able to circumvent the execute protection by running it from the interpreter. A way to prevent that is to unset the global read flag (o-r), and ensure that the group read flag is set (g+r) so that only users in the group can even read the file the command is stored in.

Danny
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed GRUB on 3rd hard drive, how do I boot 1st drive? jesusphreak Linux - Newbie 4 04-06-2005 10:34 AM
Installing SuSE on an external FireWire drive: YaST can't edit partitions on drive kivimaki Linux - Distributions 2 09-13-2004 09:52 PM
boot from floppy drive then insall linux redhat9 from HARD DRIVE Shiraz Ahmed Linux - Software 0 08-23-2004 06:11 AM
slackware 9.1 mounting problems (cd drive, cd writer drive, win partition (ntfs)) mr.gizm0 Slackware 8 05-11-2004 07:23 PM
Cannot Copy Files From Network FAT32/NTFS Drive to My Local Linux Drive michaelh Linux - Networking 3 10-29-2002 11:27 AM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration