LinuxQuestions.org
Review your favorite Linux distribution.
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-26-2016, 05:12 PM   #1
Ritchie-T
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Rep: Reputation: Disabled
SSH without sending username


Hi there,

I have been trying to get to grips with Linux and feel I have a bit of an unusual request for help

I need to be able to SSH from my Centos 6.7 box to other devices but without passing the username in the SSH request. So for example, if I am logged in as "user1" and I SSH to another device, the username "user1" is sent as part of the request. I need to stop this from happening if possible.

I have tried to search for help on this but nearly all results come back for people asking how to change the username that you SSH as, but I need to not send a username in the request at all. I need to rely on the end device to ask me for a username.

This is for an automated application that logs into devices but it expects to be prompted for a username, but when Centos sends the username in the request the device will not prompt for it and this confuses my automated script. I can go into more detail how this works if anybody needs to know.

I had the exact same set up running on Ubuntu server and I never had this problem, so I am hoping it is a feature that can be turned on or off.

Any help would be greatly appreciated.

Thanks,
Ritchie
 
Old 02-26-2016, 07:03 PM   #2
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Look into the ~/.ssh/config file and the Host options.
 
Old 02-29-2016, 04:16 AM   #3
Ritchie-T
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the reply.

I have had a look into the options available there and it seems I can pre-set which user to use for each device, but not specify no user at all.

Is the answer in there and I have missed it somewhere?

Thanks again,
Ritchie
 
Old 02-29-2016, 06:08 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Don't think its possible. At least the man ssh did not render any meaning full results. Maybe if you use ssh/config file, put in a user part but don't give it any value. Maybe you get an error from ssh or it uses the active user or asks.
 
Old 02-29-2016, 07:18 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
you can use ssh keys instead of usernames, but cannot ssh without authentication
 
Old 02-29-2016, 07:24 AM   #6
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,209

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by Ritchie-T View Post
Thanks for the reply.

I have had a look into the options available there and it seems I can pre-set which user to use for each device, but not specify no user at all.

Is the answer in there and I have missed it somewhere?

Thanks again,
Ritchie
What happens if you pre-set a user who doesn't exist?
 
Old 02-29-2016, 07:26 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
nothing, user should exist on the server side, not on the client side.
 
Old 02-29-2016, 07:37 AM   #8
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,209

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by pan64 View Post
nothing, user should exist on the server side, not on the client side.
Yup, but I'm hoping that if the server sees a request made for a non-existent user, it might force it down the route of asking for the full username/password at authentication.

As you can guess, I know nothing about this. I'm just looking at ways of solving the problem.
 
Old 02-29-2016, 08:18 AM   #9
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,650

Rep: Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568
not that, try something else...

Sorry. If ssh is given a user name it will attempt to authenticate that user and either succeed or fail. It will NOT prompt you for a different user name.

I would either change the process/script to assume the authentication has already occured, and do the authentication at the SSH layer using keys, or find a different tool.

(ssh is not the only ssh protocol client tool, there are many)
 
1 members found this post helpful.
Old 02-29-2016, 08:55 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by Ritchie-T View Post
Thanks for the reply.

I have had a look into the options available there and it seems I can pre-set which user to use for each device, but not specify no user at all.

Is the answer in there and I have missed it somewhere?

Thanks again,
Ritchie
"no user at all" is not allowed to login. You MUST provide an identity to be used on the remote machine.

rsa keys provide authentication that you are allowed to login.

A password provides authentication that you are allowed to login.

IDENTITY is who you claim to have the right to use on the system.
 
  


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
SSH without asking for username or password killthebabysitter Linux - Security 9 08-29-2011 02:27 PM
[SOLVED] su <username>: ssh to new user KillaSmooth Linux - Security 11 06-29-2011 11:12 AM
ssh tunnel username with restrictions MystKid Linux - Newbie 1 03-25-2011 01:37 PM
SSH hangs after username jantman Linux - General 5 02-02-2007 04:48 PM
SSH connection closed after username matcal Linux - Security 4 10-24-2005 12:04 PM


All times are GMT -5. The time now is 10:04 AM.

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