LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-18-2008, 10:26 AM   #1
balasubramanian
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
su command with "-" sign gives error on Wind River operating system


Hi all,

The su command used to switch the user gives the following error while executing in Wind River Linux

This is the command i executed


admin@router:~$ su - root
Password:
su: cannot set groups: Connection refused



But when i use su command without "-" sign it is working fine

admin@router:~$ su root
Password:
bash-3.1#



The following is the output i got when executing with strace command

admin@router:~$ strace -o su.log su - root
ptrace: umoven: Input/output error
Password:
ptrace: umoven: Input/output error
su: incorrect password
admin@router:~$



The following is the last 50 lines of the output of the
strace -o su.log su - root


admin@router:~$ tail -50 su.log
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
ioctl(0, TIOCGPGRP, {B38400 opost isig icanon echo ...}) = 0
open("/etc/passwd", O_RDONLY) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
newfstat(4, {st_mode=S_IFREG|0644, st_size=1815, ...}) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 1431875600, 0x4271) = 0x5555785000
read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 1815
close(4) = 0
munmap(0x5555785000, 65536) = 0
open("/etc/shadow", O_RDONLY) = -1 EACCES (Permission denied)
geteuid() = 500
pipe([0, 512]) = 4
rt_sigaction(0x12, 0xffff828790, 0xffff8287c0, 0x10) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x5555731ee0) = 6027
write(5, "root\0", 5) = 5
close(4) = 0
close(5) = 0
wait4(6027, [{WIFEXITED(s) && WEXITSTATUS(s) == 7}], 0, NULL) = 6027
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigaction(0x12, 0xffff828790, 0xffff8287c0, 0x10) = 0
getuid() = 500
geteuid() = 500
gettimeofday({946701784, 113669}, NULL) = 0
newstat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
newstat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
newstat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
sendto(3, "<85>Jan 1 10:13:04 su: pam_unix"..., 140, MSG_NOSIGNAL, {...}, 366505840640) = 140
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
socket(PF_NETLINK, SOCK_RAW, 9) = 4
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
readlink("/proc/self/exe", "/bin/su", 4095) = 7
sendto(4, "\0\0\0p\4L\0\5\0\0\0\1\0\0\0\0PAM: authenticat"..., 112, 0, {sa_family=AF_UNSPEC, sa_data="\0\0\376&\0\0f1\0\10\0024\220/"}, 4) = -1 ECONNREFUSED (Connection refused)
close(4) = 0
munmap(0x55557a5000, 68720) = 0
munmap(0x555583e000, 70784) = 0
munmap(0x5555850000, 162680) = 0
munmap(0x55557b6000, 174432) = 0
munmap(0x55557e1000, 378976) = 0
munmap(0x5555878000, 279184) = 0
munmap(0x55558bd000, 118768) = 0
munmap(0x55558da000, 166896) = 0
munmap(0x5555903000, 71040) = 0
munmap(0x5555915000, 68032) = 0
write(2, "su: ", 4) = 4
write(2, "incorrect password", 18) = 18
write(2, "\n", 1) = 1
close(1) = 0
close(2) = 0
exit_group(1) = ?
 
Old 11-18-2008, 12:25 PM   #2
wit_273
Member
 
Registered: Mar 2007
Location: Nebraska
Distribution: CentOS
Posts: 82

Rep: Reputation: 15
Quote:
This is the command i executed


admin@router:~$ su - root
Password:
su: cannot set groups: Connection refused


But when i use su command without "-" sign it is working fine
When you su to root you do not specify a username, with no user name given root is assumed. Basically su has two meanings, Super User (root no user specified) and Switch User (other user user specified).

You to enter root you just need
Code:
su -
you do not need to specify user root.

If needing to access a different user you use
Code:
su USERNAME
You do not use the - when specifying a username.

You can also su to root without using the - (also not specifying the username), but this will not give you access to roots specific path and several other things. So you normally want to use the -
 
Old 11-19-2008, 01:41 AM   #3
balasubramanian
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wit_273 View Post
When you su to root you do not specify a username, with no user name given root is assumed. Basically su has two meanings, Super User (root no user specified) and Switch User (other user user specified).

You to enter root you just need
Code:
su -
you do not need to specify user root.

If needing to access a different user you use
Code:
su USERNAME
You do not use the - when specifying a username.

You can also su to root without using the - (also not specifying the username), but this will not give you access to roots specific path and several other things. So you normally want to use the -
hi

Thanks for your reply
but the i have the same behaviour when i try su command with
su - and su - root

The issue is that when i run su command with "-" ( as i want the /etc/profile to be executed when i do su ) i get the error which i have mentioned in the previous post

Thanks in advance


Regards,
Bala
 
  


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
"Error loading operating system" upon first reboot after install Unforgiver Linux - Newbie 4 01-03-2012 04:42 AM
LXer: Wind River to host "Developer Day" LXer Syndicated Linux News 0 07-02-2008 05:30 PM
linux operating system built-in telnet command can use "VT400" function keys and key? hocheetiong Linux - Newbie 1 05-27-2008 03:54 PM
error during Ubuntu install, now says "Missing Operating System" DJGCrusader Linux - Newbie 6 08-11-2007 08:12 PM
"Error loading operating system" in WinXP dual boot saskee Ubuntu 1 02-03-2006 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:48 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