LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-14-2003, 07:54 PM   #1
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Rep: Reputation: 15
Modem works as root but not as regular user.


How would I go about getting it to run as non-root?
This is what I did to get it operational
~~
cd /dev; test -c ttyS4 || /MAKEDEV ttyS4; chmod 666 /dev/ttyS4
setserial /dev/ttyS4 uart 16550A port (?) IRQ 9
baud_base 115200 spd_vhi skip_test
ln -sf /dev/ttyS4 /dev/modem
~~
Should I make ttyS4 777; or can links have permissions as well?
~~
root@bmike1:~# ls -l /dev/modem
lrwxrwxrwx 1 root root 10 Aug 14 15:09 /dev/modem -> /dev/ttyS4
root@bmike1:~#
~~
Never mind the link already has unrestricted access.
So what do I need to do?

I just listed out the directory of ttyS4 and this is what it says:
root@bmike1:~# ls -l /dev/ttyS4
crw-r--r-- 1 root dialout 4, 68 Aug 14 15:53 /dev/ttyS4
root@bmike1:~

Should I chmod it?
I believe that currently that mode is 711. Am I correct? Is there such a setting as 700 (as in rwx------)? If that is so that means there is also 000 (no permission for anyone). Or is the lowest you can go 111?
 
Old 08-14-2003, 09:02 PM   #2
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
okay what distro are you using? if you have a network configuration utility there may be option to let normal users activate the device.
 
Old 08-15-2003, 02:06 AM   #3
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
I run Debian. But I got instructions on fixong it. I was instructed to chmod 660 /dev/ttyS4
Unfortunately, when I went to test it, adter I put login name and password and then pressed enterthe screen went blank, blacked out, and then the kugin dcreen appeared again. Then when I tried to login to that account from root it replied:
bash-2.05b$ su bmike1
Password:
bash: /dev/null: Permission denied
and repeated thr permiddion denied until cntrl-c wasd pressed. What's up with this?
 
Old 08-15-2003, 06:33 AM   #4
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
/dev/null is a non-real device, it is like sending you to oblivion.

you can either delete the user mike1 and add again, or look at the /etc/passwd file. in that you should see mike1 and some weird entry stuff. is /dev/null there? if so, change it to /home/mike1. sounds to me like the home directory for mike1 got changed somehow. if you send me the /etc./passwd entry for mike1 i may be able to help more. don't change if not appearing like i said, just send the output here.

or type usermod -s /bin/bash -d /home/mike1 mike1

this should change the file to what you want. i would just suggest deleting mike1 and readding. unless mike1`has critical data in his home directory. you may want to add a new user and try logging in to see what happens first.

let me know.

sorry i just noticed it was bmike1, but otherwise same things.
 
Old 08-15-2003, 06:25 PM   #5
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
I attempted both of your solutions but it acted the same. First, when I tried to login as bmike1 the sscreen blacked out and then the login screen appeared again (like it had just been started), Then, after loging in as root, when I attempted to switch user to bmike1 from a terminal window

root@bmike1:~# su bmike1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
on until ^C was pressed.

Here is the relevant /etc/passwd:
bmike1:x:1000:1000:Michael Havens,,,480-615-1310:/home/bmike1:/bin/bash

Here is the whole thing:


root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13roxy:/bin:/bin/sh
majordom:x:30:31:Majordomo:/usr/lib/majordomo:/bin/sh
postgres:x:31:32ostgres:/var/lib/postgres:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
msql:x:36:36:Mini SQL Database Manager:/var/lib/msql:/bin/sh
operator:x:37:37:Operator:/var:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats/gnats-db:/bin/sh
mysql:x:100:103:MySQL Server:/var/lib/mysql:/bin/false
postfix:x:102:65534:Postfix Mailsystem:/var/spool/postfix:/bin/false
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
sshd:x:103:65534:SSH Server:/var/run/sshd:/bin/false
partimag:x:104:65534::/home/partimag:/bin/false
telnetd:x:101:101::/usr/lib/telnetd:/bin/false
distccd:x:105:65534::/:/bin/false
bind:x:106:108::/var/cache/bind:/bin/false
sslwrap:x:107:1001::/etc/sslwrap:/bin/false
bmike1:x:1000:1000:Michael Havens,,,480-615-1310:/home/bmike1:/bin/bash
(END)

It is strange. It is as if by trying to login as non-root it is interpreting it as "login as another user".
 
Old 08-15-2003, 06:51 PM   #6
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
did you try reversing the permission mod made to the modem to see if can at least get back to where you were when normal users could log in? then maybe can try different permission settings from there. if that doesn't fix it then i am not sure. that is the only change you made right? before this started happening anyway.
 
Old 08-15-2003, 07:22 PM   #7
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
I think something that might be key is the fact that when I attempt to log in as non-root it acts as if I was already logged in and just told it to login as another user or that I just turned it on. But the really strange thing is the permission denied into infinity when doing the switchuser command.!
To try the permissions thing again what do you think the permissions were before?

Last edited by bmike1; 08-15-2003 at 07:25 PM.
 
Old 08-16-2003, 06:29 AM   #8
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
try 0777 to see if it helps just so it is open to all then we can try to get back to normal.
 
Old 08-16-2003, 12:41 PM   #9
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
0777? I thought permissions were only 3 digits long. What does the leadin 0 mean?
I tried it and the same thing occured: the screen blacked out and then reset itself at the login screen. And if I just tried su bmike1 it tells root that permission is denied.
I also tried 7777 but no dice.

Last edited by bmike1; 08-16-2003 at 01:10 PM.
 
Old 08-17-2003, 09:48 PM   #10
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
Well, I solved that problem but opened a whole new can of worms. I solved it by reinstalling Debian. SO now I can log in as anything I want but operating the modem is anotherthing. First I changed the permissions of kppp to 777 and that let it dial out. Then it 'dies unexpectedly' with the error message of 0. What do you want me to do?
 
Old 08-18-2003, 02:47 PM   #11
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
this is what hAPPens with the modem since the reinstall.....
1- it dials in
2- handshake with ISP
3- Hang up with a status of zero. 'man pppd' state zero means: "Pppd has detached, or otherwise the connection was successfully established and terminated at the peer's request."
 
Old 08-18-2003, 04:27 PM   #12
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Quote:
Originally posted by bmike1
Well, I solved that problem but opened a whole new can of worms. I solved it by reinstalling Debian. SO now I can log in as anything I want but operating the modem is anotherthing. First I changed the permissions of kppp to 777 and that let it dial out. Then it 'dies unexpectedly' with the error message of 0. What do you want me to do?
You should not have done that. 777 is always a risk. If you want to be able to dialout your user must be in the dialout group. So adding that user to that group would have solved the first problem. After your change you need to logout and login again.
 
Old 08-18-2003, 04:29 PM   #13
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Quote:
Originally posted by bmike1
I attempted both of your solutions but it acted the same. First, when I tried to login as bmike1 the sscreen blacked out and then the login screen appeared again (like it had just been started), Then, after loging in as root, when I attempted to switch user to bmike1 from a terminal window

root@bmike1:~# su bmike1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
on until ^C was pressed.
what does ls -l /dev/null say ? Permissions should be rw for everybody ...
 
Old 08-18-2003, 04:30 PM   #14
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
did you change any of the default permissions in /dev ?
 
Old 08-18-2003, 05:53 PM   #15
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Original Poster
Rep: Reputation: 15
/dev/null is correct and I have no idea of what you are talking about Marcus. Whaqt is a default permission and how do I find it? I typed in ls -l /dev |grep /dev thinking that there might be a dev file in the directory of the same name but it said
lrwxrwxrwx 1 root root 20 Aug 16 12:51 cdaudio -> /KNOPPIX/dev/cdaudio
lrwxrwxrwx 1 root root 9 Aug 16 12:51 cdrom -> /dev/scd0
lrwxrwxrwx 1 root root 16 Aug 16 12:51 dvd -> /KNOPPIX/dev/dvd

So that means I need to be taught about default permissions.
 
  


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
Moving from root to regular user KingOfDreams Linux - General 1 01-14-2005 05:46 AM
changing login from root to a regular user paul62 Slackware 4 10-13-2004 03:17 AM
CD writing works in root but not for regular user lasindi Linux - Software 5 08-29-2004 12:25 AM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 05:27 PM
can't login as regular user (root only) DontKnowNothing Mandriva 2 10-24-2003 02:36 PM


All times are GMT -5. The time now is 06:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration