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 02-21-2012, 08:07 PM   #1
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Rep: Reputation: Disabled
Can not connect to terminal with any user


So I want to use screen to run a program, but I can only connect to the terminal with root. If I try to connect with a user it just keeps saying access is denied. I have setup 1 user and password and I can su to the user but screen wont work that way. I have changed the password multiple times and I know I'm typing the right password in but it still will not let me connect unless I am logging in with root.

Edit: I forgot to add that I am running CentOS 6.

Last edited by mmorto89; 02-21-2012 at 08:18 PM.
 
Old 02-21-2012, 08:38 PM   #2
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Edit: here is the commands I used to make the username "mike"

[root@server ~]# useradd mike
[root@server ~]# passwd mike
Changing password for user mike.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@server ~]#

Last edited by mmorto89; 02-21-2012 at 08:56 PM.
 
Old 02-21-2012, 08:45 PM   #3
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
Would you please give the commands that you entered?

Your description is misleading.

On the one hand you say you want to use screen on the other you say that you can't connect to terminal.

login with the user name who is running the screen session.
Issue "screen -ls" and you can see how many sreen sessions are running.
If only one is running you can connect to it with "screen -x"
If there are more you have to use the name or pid:name showed by -ls
Something like "screen -x -S name"
or "screen -x -S pid:name"

But I'm not sure whether you are talking from that at all.
 
Old 02-21-2012, 08:51 PM   #4
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
I'm sorry for being misleading, but my problem is I can only connect to the terminal with root, but I need to connect with my username "mike" to use screen because the program I want to run is in the home directory under that user name. So I can connect to the terminal with root but not "mike". I also know how to use screen. So when I go to the terminal here is what it says.

login as: mike
mike@xxx.141.254.50's password:
Access denied
mike@xxx.141.254.50's password:

but when I login as root it works perfectly fine.

Last edited by mmorto89; 02-26-2012 at 01:35 AM.
 
Old 02-21-2012, 08:56 PM   #5
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
Well, root can run every programm.
And root can "su mike" without beeing prompted for a password.

something is wrong with the account of "mike".
As root you can can correct this.

Do you use "ssh" to connect to the machine?

"su" stands for SubstituteUser
 
Old 02-21-2012, 09:02 PM   #6
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
I use the program putty to connect remotely. This is a dedicated server service. I can not run screen when I login as root and and su to mike here is the terminal entry when I do that.


[root@server ~]#
[root@server ~]# su mike
[mike@server root]$ screen
Cannot open your terminal '/dev/pts/0' - please check.
[mike@server root]$
 
Old 02-21-2012, 09:08 PM   #7
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 215

Rep: Reputation: 66
When you use putty have you tried to login with mike? What happens.

As root run the following commands and post their output:

cat /etc/passwd

ls -l /home

id mike
 
Old 02-21-2012, 09:12 PM   #8
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
[root@server ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0perator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:4294967294:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:156:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
webapps:x:500:500::/var/www/html:/bin/false
named:x:25:25:Named:/var/named:/sbin/nologin
diradmin:x:101:157::/usr/local/directadmin:/bin/false
mysql:x:102:158:MySQL server:/var/lib/mysql:/bin/false
majordomo:x:103:2::/etc/virtual/majordomo:/bin/false
dovecot:x:104:104::/home/dovecot:/bin/false
admin:x:501:501::/home/admin:/bin/bash
mike:x:502:503::/home/mike:/bin/bash
gdm:x:42:42::/var/gdm:/sbin/nologin

[root@server ~]# ls -l /home
total 36
drwx--x--x 7 admin admin 4096 Feb 20 20:06 admin
drwxr-xr-x 2 root root 4096 Dec 9 2010 ftp
drwx------ 26 mike mike 4096 Feb 21 18:53 mike
drwx------ 4 503 504 4096 Feb 21 19:35 test
drwxrwxrwt 2 root root 4096 Feb 21 00:10 tmp

[root@server ~]# id mike
uid=502(mike) gid=503(mike) groups=503(mike)
 
Old 02-21-2012, 09:13 PM   #9
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
What is this box running?
Which version?
What services this box offers?


And i would correect the login problem of user mike instead of starting screen.
It is never a good idea to even let root login from remote site.
 
Old 02-21-2012, 09:16 PM   #10
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
Quote:
Originally Posted by mmorto89 View Post
[root@server ~]# cat /etc/passwd

operator:x:11:0perator:/root:/sbin/nologin
???? something seriously damaged?
 
Old 02-21-2012, 09:19 PM   #11
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uhelp View Post
???? something seriously damaged?
Im not sure? the smiley is from the fourms smiley things, but is that wrong? should it say something else?
 
Old 02-21-2012, 09:28 PM   #12
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
Quote:
Originally Posted by uhelp View Post
What is this box running?
Which version?
What services this box offers?
And?
 
Old 02-21-2012, 09:34 PM   #13
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uhelp View Post
And?
are you asking for the OS on the server? That is centOS 6 sorry i'm not sure what your asking.
 
Old 02-21-2012, 09:46 PM   #14
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
Which services does this machine offer?
It offers a ssh as you log in with Putty, I think.
Is there a web server running?
All kind of servers I'd like to know.

It got a strange layout at /home anyway..

First try to log in as root and change the password for mike
Code:
passwd mike
Then try to log in as mike with the new password.

If it doesn't help, log in again as root and do this:
Code:
cat /etc/pam.d/passwd
and paste the output here.
 
Old 02-22-2012, 07:00 AM   #15
mmorto89
LQ Newbie
 
Registered: Feb 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
[root@server ~]# cat /etc/pam.d/passwd
#%PAM-1.0
auth include system-auth
account include system-auth
password include system-auth
[root@server ~]#

Changing my password did not work, it still says access is denied when I try to login.
 
  


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
Connect to Xterm terminal remotely fjkum Linux - Newbie 2 12-18-2008 01:10 AM
can't connect to any server through terminal restles.s Linux - Networking 8 08-22-2007 03:47 AM
Need Shell Script to allow user to connect to net through terminal Dralnu Linux - Networking 1 05-07-2006 10:31 AM
using fedora to connect to m$ terminal server jbzy3000 Fedora 6 03-05-2005 10:19 AM
root cannot connect to an X server in a terminal GameboyHippo Linux - Software 4 02-09-2004 11:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:52 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
Open Source Consulting | Domain Registration