Problem with SFTP Command line, "@" in username.


 
Thread Tools Search this Thread
Operating Systems Linux Problem with SFTP Command line, "@" in username.
# 8  
Old 04-27-2018
Quote:
Originally Posted by BG_JrAdmin
I tried it with both regular and double quotes.

Code:
# sftp -o User='myuser@myorg.com' sftpsite.com
Property of #Company# Systems. Unauthorized use prohibited.
Received disconnect from # SFTP Server IP ADDRESS # port 22:11: Application error
Authentication failed.
Couldn't read packet: Connection reset by peer

this is not what I suggested - loose the space after -o
Also try it withOUT quotes.
man sftp
This User Gave Thanks to vgersh99 For This Post:
# 9  
Old 04-27-2018
Look for the port entry in the configuration files...
# 10  
Old 04-27-2018
This is what's valid to put in a UNIX username:

Code:
[a-z_][a-z0-9_-]*[$]?

No @.
# 11  
Old 04-28-2018
I find this discussion interesting. I thought I was familiar with email addresses being used as userid's on sFTP and therefore, by default, containing the @ character. I'm sure that I remember this from years ago.

Searching the web these pages seem relevant:

shell - command line sftp: email address as username - Stack Overflow

ssh - How do I sftp to a server if the username contains @ symbol - Unix & Linux Stack Exchange

From your post#7 it seems to me that, since the error mentions 'port' (for the first time????) that the server may not be listening on default port 22 and, if so, a port number would need to be included on your command line. Perhaps talk to the remote server's sysadmin and confirm which port number sFTP is on.

You have a lot of skilled subscribers to this thread now so I'll be interested to see how this develops.

Good luck.

Last edited by hicksd8; 04-28-2018 at 05:42 AM..
# 12  
Old 04-29-2018
Quote:
Originally Posted by Corona688
This is what's valid to put in a UNIX username:

Code:
[a-z_][a-z0-9_-]*[$]?

No @.
This is correct, but this is not a UNIX username: it rather is an identification similar to what in past times was used in (anonymous) ftp where one entered his own email address. This probably is a chrooted anonymous sftp-server thread-o/p is connecting to.

I hope this helps.

bakunin
# 13  
Old 04-29-2018
I've opened a case with Red Hat support. I will post the results.

---------- Post updated at 08:06 PM ---------- Previous update was at 07:25 PM ----------

@vgersh99

Code:
[root@MyServer ~]# sftp -oUser='myemail@myorg.com' sftpsite.com
Property of #Company# Systems. Unauthorized use prohibited.
Received disconnect from # IP ADDRESS # port 22:11: Application error
Authentication failed.
Couldn't read packet: Connection reset by peer


[root@MyServer ~]# sftp -oUser=myemail@myorg.com sftpsite.com
Property of #Company# Systems. Unauthorized use prohibited.
Received disconnect from #IP ADDRESS# port 22:11: Application error
Authentication failed.
Couldn't read packet: Connection reset by peer
[root@MyServer ~]#

---------- Post updated at 08:13 PM ---------- Previous update was at 08:06 PM ----------

Code:
[root@Myserver ~]# bash -version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@Myserver ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
[roott@MyServer ~]#

---------- Post updated at 08:23 PM ---------- Previous update was at 08:13 PM ----------

It seems they are running proFTPD:

This is from my debug output:

Code:
debug1: Remote protocol version 2.0, remote software version mod_sftp/0.9.8
debug1: no match: mod_sftp/0.9.8
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to sftpsite.com

---------- Post updated at 08:33 PM ---------- Previous update was at 08:23 PM ----------

Trying to escape the @

Code:
[root@MyServer ~]# sftp -oUser='myemail\@myorg.com' sftpsite.com
Property of #Company# Systems. Unauthorized use prohibited.
myemail\@myorg.com@sftpsite.com password:

---------- Post updated at 08:35 PM ---------- Previous update was at 08:33 PM ----------

Code:
[root@MyServer ~]# sftp -oUser=myemail\@myorg.com sftpsite.com
Property of #Company# Systems. Unauthorized use prohibited.
Received disconnect from #IP Address# port 22:11: Application error
Authentication failed.
Couldn't read packet: Connection reset by peer
[root@MyServer ~]#

# 14  
Old 04-30-2018
Quote:
Originally Posted by bakunin
This is correct, but this is not a UNIX username: it rather is an identification similar to what in past times was used in (anonymous) ftp where one entered his own email address.
sftp is not ftp. It's ssh, fundamentally - a shell login.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Why does "ps -[u|U] username" not list processes when username is numeric?

Greetings, The title pretty much says it all. I've snooped everywhere and can't find anything on this. Since our organization went to numeric usernames, using the u|U option for ps returns no processes. Example passwd entry: 320074:DjZAJKXun8HBs:10129:6006:Joe Y:/cadhome/analysis/jy:/bin/bash... (4 Replies)
Discussion started by: crimso
4 Replies

2. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

3. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

4. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

7. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

8. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

10. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies
Login or Register to Ask a Question