Please let me know which ports are used for data transfer, as per my understaning in Linux below ports are used for data transfer from windows to Linux.
ftp 21
sftp 22 (Most secure Port)
telnet 23
any other port?
wheather we can change the port no 22 to any other port no for a particular user only and how?
To change ports SSH ports, first edit as root, the sshd configuration file.
vi /etc/ssh/sshd_config
Then edit the line which states 'Port 22' and choose an appropriate port not already used on the system.
Doing this, you must be aware that some ports should NOT be used (0 through 1023) and better avoid those from 1024 through 49151. Pick up one from 49152 through 65535 and you'll be fine for now.
Last, restart SSH :
/etc/init.d/ssh restart
And then see if SSH is listening on the new port (Port number now needs to be declared).
ssh username@hostname.com -p 49951
Port redirection may also be an option (see in your router). I don't know what you're aiming at. Could you be more specific ?
Thanks Vincent72 for quick reply but my requirement is ,I have to allocate different port no for ssh for specific user only, other users will continue with port 22 only. how to achieve this?
Just add additional port(s) in the config file sshd_config
As per manual page.
Port Specifies the port number that sshd(8) listens on.
The default is 22. Multiple options of this type are permitted. See also
ListenAddress.
.....
If port is not specified, sshd will listen on the address and all
prior Port options specified. The default is to listen on all
local addresses. Multiple ListenAddress options are permitted.
Additionally, any Port options must precede this option for non-
port qualified addresses.
Not sure to understand... Let's say you have user1's SSH port set on 49592 on his machine. That means you can reach him by ssh on this port. Other users on the network will remain accessible on port 22.
To be more specific, are you trying to reach one user in particular from outside of the network at a specific port or are we talking of doing so from the same network ?
The solution I described in my first post works from the same network with user D having a different port configuration.
Then again, if you want to connect to him from outside of the network, you'll have to configure port redirection in your router.
Let's say user D has lan IP : 192.168.0.10, you'd have to configure a port redirection so incoming requests get redirected to the relevent port at this address.
Additionnally, you can configure your internal ssh server to listen on multiple port numbers, so you can still use port 22 internally.
In /etc/ssh/sshd_config you'd have something like :
Port 22
Port 49952
Meaning you can still use port 22 internally and use the second one to connect to this server from the outside after setting up the right port redirection in your router.