LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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


Closed Thread
  Search this Thread
Old 10-21-2010, 11:42 AM   #1
sammyboy161
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: Disabled
SFTP server port blocked on Uni network, need to change the listening port.


Hey guys,

VERY new to linux, erm but I have an issue that needs solving!

I recently moved to university, where their network blocks sftp port 22, this means that I cannot connect to my FTP server which is running a version of linux.

Now I've got this ftp server connected to a seedbox and it was created using the following walkthrough..
Code:
I have written this guide for a friend, but I though it would be useful for others as well.

There are several guides floating around, but I found that most always cock up in some way. This one is tried and tested to work on Debian Etch (on an OVH rps, but should apply to most servers).

If there is a new stable release of rtorrent/libtorrent then I will update this guide to show you how to update it (without reinstalling the whole server).

At the bottom there are also instructions to install ftp access & some network monitoring software



Login to your server as root (with putty), then enter:



passwd




Change you password (try this generator to get something secure), then enter:



apt-get install sudo ntp



 

apt-get update && apt-get upgrade

reboot




Log back in. Next sort out the time:



/etc/init.d/ntp stop && ntpdate pool.ntp.org && /etc/init.d/ntp start


If you get an error just skip it.



FOR OVH USERS: Lets just remove their support access for security:



rm /root/.ssh/authorized_keys2





Install all the software:



http://pastebin.com/f64c94716


(Copy and paste the code from that link into putty, not the actual link)



Create the rtorrent user:



adduser rt




Follow the instructions (& remember the password), then:



visudo




Now change:

 

root ALL = (ALL) ALL




To:



root ALL = (ALL) ALL

rt   ALL = (ALL) ALL


To save press Ctrl+O, follow the instructions, then exit with Ctrl+X.


Logout (with "exit"), then start putty again and login with the new user "rt".



Install xmlrpc-c:

 

cd

svn co https://xmlrpc-c.svn.sourceforge.net...rpc-c/advanced xmlrpc-c

cd xmlrpc-c/

./configure --disable-cplusplus

make && sudo make install


You'll need to re-enter you password for that last line.


Now libtorrent:



cd

wget http://libtorrent.rakshasa.no/downlo...-0.12.5.tar.gz

tar zxvf libtorrent-0.12.2.tar.gz

cd libtorrent-0.12.2

./autogen.sh

./configure

make && sudo make install




Then rtorrent (that odd configure line is important!):



cd

wget http://libtorrent.rakshasa.no/downlo...t-0.8.5.tar.gz

tar zxvf rtorrent-0.8.2.tar.gz

cd rtorrent-0.8.2

./autogen.sh

./configure --with-xmlrpc-c

make && sudo make install





Moving on to wtorrent:



cd /var/www

svn co svn://wtorrent-project.org/repos/trunk/wtorrent/

cd wtorrent

sudo mv * ..

sudo mv .* .. 

(ignore the little error it makes)

cd ..

sudo rm -r wtorrent

sudo touch ./db/database.db

sudo chown -R www-data:www-data db torrents tpl_c

sudo nano conf/sample.user.conf.php


Edit this to suit your needs, set RT_AUTH to true and put your username and password for the rt user (what you should be logged into at the moment) into 'RT_USER' 'rt' and 'RT_PASS' 'the password'.

Also don't forget to change 'DIR_EXEC' to '/var/www/' & 'DIR_DOWNLOAD' to '/home/rt/torrents/doing/'.

Save & close with Ctrl+O then Ctrl+X.


Rename the file:



sudo mv conf/sample.user.conf.php /conf/user.conf.php





rtorrent needs some folders:



cd

mkdir ./torrents

mkdir ./torrents/watch

mkdir ./torrents/doing

mkdir ./torrents/done

mkdir ./.rtsession





Sort out the config files:



cd

wget http://flipsidereality.com/blog/wp-c...-howto.tar.bz2

tar xvfj rtorrent-howto.tar.bz2

cd rtorrent-howto-files

sudo mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.dist

sudo cp rtorrent /etc/init.d

sudo chmod a+x /etc/init.d/rtorrent

sudo update-rc.d rtorrent defaults 25





Some more config files:



cd

sudo nano .rtorrent.rc


Go to http://pastebin.com/f759d9bb9 and copy what is in the file into the terminal (to paste in putty right click).

Save & exit as normal.


Next:



sudo nano /etc/lighttpd/lighttpd.conf


Do the same as before, copy this in: http://pastebin.com/f4bc19085

Save & close.



Get a few rights right... :

 

sudo usermod -aG tty rt

sudo chown rt:rt /home/rt -R

sudo chmod 777 /home/rt/torrents -R





Finally:



sudo /etc/init.d/lighttpd restart

sudo /etc/init.d/rtorrent start





Now visit in firefox:

 

your servers ip/install.php




Fill it with the details, then once that has run, remove the install file in putty with:



sudo rm /var/www/install.php





Visit: your-servers-address, enjoy

(login with the details you entered in the install.php page)

If you have any issues feel free to PM me.



To install ftp access:

Use filezilla, login with the sftp method and the rt users details.

This transfers files over ssh, so no need for an ftp server. It is also much more secure, ideal for such a application.



Network Statistics

If you would like to record and view your servers network activities then follow what's below.

Install vnstat:



sudo apt-get install vnstat

sudo vnstat -u -i eth0


You can replace "etho" with the interface that you wish to monitor.

Install the front end:



cd /var/www

sudo mkdir stats

sudo wget http://www.sqweek.com/sqweek/files/v...d-1.4.1.tar.gz

sudo tar -zxf vnstat_php_frontend-1.4.1.tar.gz -C stats

cd stats/vnstat_php_frontend-1.4.1

sudo mv * ..

sudo rm -rf vnstat_php_frontend-1.4.1

sudo chown -R www-data:www-data /var/www/stats



Then edit the following file:



sudo nano /var/www/stats/config.php


Remove what's there and paste in this: http://pastebin.com/f692df5f6
Change "$iface_list = array('eth0');" & "$iface_title['eth0'] = 'Internet';" if you use a diffrent interface.

Visit: your-servers-address/stats
Im not sure whether that helps, I just imagined that knowing what ive got installed, and Im hoping people can work it out from that, would help.

Basically, I would really like someone to be able to construct the commands on how to change the listen port for sftp connection on linux or add another port to the list that Linux would use so that I could put in through putty.

Many thanks,

Sammyboy161
 
Old 10-21-2010, 11:58 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sammyboy161 View Post
Hey guys,

VERY new to linux, erm but I have an issue that needs solving!

I recently moved to university, where their network blocks sftp port 22, this means that I cannot connect to my FTP server which is running a version of linux.

Now I've got this ftp server connected to a seedbox and it was created using the following walkthrough..

Im not sure whether that helps, I just imagined that knowing what ive got installed, and Im hoping people can work it out from that, would help.

Basically, I would really like someone to be able to construct the commands on how to change the listen port for sftp connection on linux or add another port to the list that Linux would use so that I could put in through putty.
While we understand your dilema, as a rule we cannot (nor should we), provide information on how to 'get around' security rules of any organization. They're there for a reason.

Two possible solution: one is talking to the university, and see what is acceptable to do on their network. The second is to read the man page on sshd_config.
 
Old 10-21-2010, 12:03 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And closed per the above post. The request is against LQs explicit rules.
 
  


Closed Thread



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
server unexpectedly port blocked l0lz Linux - Server 1 10-23-2009 10:43 PM
sshd server not listening to port 22 apulu Linux - Newbie 17 02-25-2008 05:16 AM
How to change listening port of echo server [RH9]? immer Linux - Networking 5 11-29-2003 04:30 PM
vsFTPd: change listening port RinGz Linux - Networking 2 11-15-2003 07:35 PM
X server crashing - port listening time112852 Linux - Software 9 10-06-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:17 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
Open Source Consulting | Domain Registration