- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- logname command do not remotely via ssh
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2010 06:14 AM
тАО03-30-2010 06:14 AM
/usr/bin/logname: no login name
xxxxx pts/3 Mar 29 07:08
# ssh hostname logname
/usr/bin/logname: no login name
logname: no login name
# echo $?
1
any one seen/experienced a similar situation?Not sure why logname is failing. Both source and target are RHEL AS U4
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2010 10:08 AM
тАО03-30-2010 10:08 AM
Re: logname command do not remotely via ssh
Check to see that the user exists on both systems and has the same mumeric id in /etc/passwd .
The message seems to indicate the login name does not exist on the target system.
Try:
whoami
who am i
enclose multiple command line parameters in double quotes
try ssh username@servername
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2010 01:59 PM
тАО03-30-2010 01:59 PM
Re: logname command do not remotely via ssh
Use the "-t" option with SSH to make it allocate a pseudo-TTY even with non-interactive sessions. For example:
ssh -t hostname logname
I made a quick test and "ssh -t" seems to fix the problem.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2010 04:05 AM
тАО04-11-2010 04:05 AM
Re: logname command do not remotely via ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 03:55 AM
тАО04-12-2010 03:55 AM
Re: logname command do not remotely via ssh
The "connection closed" message probably comes from your SSH client.
Perhaps the "logname" command at the target server outputs the correct answer, but without the LF character at the end? Then the "connection closed" message from the SSH client might overwrite the answer on your screen.
Or perhaps the end of the "logname" process at the target end triggers the tear-down of the connection, without making sure that all the data in various outgoing buffers has been transmitted? (This might be a SSH bug.)
I think I saw such behaviour once somewhere.
Please try these commands:
ssh -t hostname "logname; echo"
ssh -t hostname "logname; sleep 1"
One or both of these should fix the problem, no matter the cause.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2010 05:18 AM
тАО04-13-2010 05:18 AM
Re: logname command do not remotely via ssh
"
root
Connection to hostname closed.
"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2010 05:40 AM
тАО04-13-2010 05:40 AM
SolutionIn that case, you'll need to add the -q option to ssh:
ssh -qt hostname logname
MK